just ask jar for all the options
java -jar jboss-cli-client.jar --help
--controller is what you are looking for.
you can also change that in jboss-cli.xml
Let me give a little more detail.
I already have the "remoting" setup in the jboss-cli.xml. The problem is whenever I connect to the JBoss server in the Jython script, I get the following warning.
WARN: can't find jboss-cli.xml. Using default configuration value.
Here is how i'm loading the jboss-cli-client.jar in the jython interactive mode.
jython -J-cp ./jboss-cli-client.jar
>>> from org.jboss.as.cli.scriptsupport import CLI
cli = cli.newInstance()
At the cli.connect is where the connection fails, because its is using the default of "http-remoting" instead of "remoting" and it cannot find the jboss-cli.xml where the "remoting" is defined.
in that case it is simpler just use different connect method.
this is the one you are looking for:
public void connect(String protocol, String controllerHost, int controllerPort, String username, char password)
see wildfly-core/CLI.java at master · wildfly/wildfly-core · GitHub for more details
Thanks Tomaz ... that worked !!!
Also, this link should be updated with the info that Tomaz provided with the optional (String protocol).
Currently the information from the link you provided only shows:
connect(String controllerHost, int controllerPort, String username, char password)
Connect to the server using a specified host and port.
Thanks Carlton. It's updated now.