With this option is is possible to connect directly to the TCP agent listener port. This skips the connect to an HTTP(S) port to retrieve the connection information.
This is useful in scenarios where the master does not expose an HTTP(S) port, for example Jenkinsfile Runner.
Here is an example how the connect on agent side would look like. Most parameters are provided automatically when you enable the Direct Connection option.
java -cp agent.jar hudson.remoting.jnlp.Main \ -headless \ -workDir <WORK_DIRECTORY> \ -direct <MASTER_HOST:TCP_AGENT_LISTENER_PORT> \ -protocols JNLP4-connect \ -instanceIdentity <INSTANCE_IDENTITY> \ <SECRET_STRING> <AGENT_NAME>
You find more information in the Jenkins Remoting project.
Note: In Direct Connection mode agents will not be able to reconnect to a restarted master if a Random 'TCP port for inbound agents' is configured!
Note: Direct Connection requires a jnlp-slave image with a version equal or higher than 3.35-5.