Use WebSocket to connect to the Jenkins master rather than the TCP port. See JEP-222 for background.