{
    "componentChunkName": "component---src-templates-post-js",
    "path": "/blog/2020/02/02/web-socket/",
    "result": {"data":{"blog":{"html":"<div class=\"paragraph\">\n<p>I am happy to report that jep:222[] has landed in Jenkins weeklies,\nstarting in <a href=\"/changelog/#v2.217\">2.217</a>.\nThis improvement brings experimental WebSocket support to Jenkins,\navailable when connecting inbound agents or when running the CLI.\nThe WebSocket protocol allows bidirectional, streaming communication over an HTTP(S) port.</p>\n</div>\n<div class=\"paragraph\">\n<p>While many users of Jenkins could benefit,\nimplementing this system was particularly important for CloudBees\nbecause of how <a href=\"https://docs.cloudbees.com/docs/cloudbees-core/latest/\">CloudBees Core on modern cloud platforms</a>\n(i.e., running on Kubernetes) configures networking.\nWhen an administrator wishes to connect an inbound (formerly known as “JNLP”) external agent to a Jenkins controller,\nsuch as a Windows virtual machine running outside the cluster and using the agent service wrapper,\nuntil now the only option was to use a special TCP port.\nThis port needed to be opened to external traffic using low-level network configuration.\nFor example, users of the nginx ingress controller\nwould need to proxy a separate external port for each Jenkins service in the cluster.\nThe instructions to do this are complex and hard to troubleshoot.</p>\n</div>\n<div class=\"paragraph\">\n<p>Using WebSocket, inbound agents can now be connected much more simply when a reverse proxy is present:\nif the HTTP(S) port is already serving traffic,\nmost proxies will allow WebSocket connections with no additional configuration.\nThe WebSocket mode can be enabled in agent configuration,\nand support for pod-based agents in the <a href=\"https://plugins.jenkins.io/kubernetes\">Kubernetes plugin</a> is coming soon.\nYou will need an agent <a href=\"https://github.com/jenkinsci/remoting/releases/tag/remoting-4.0\">version 4.0</a> or later,\nwhich is bundled with Jenkins in the usual way (Docker images with this version are coming soon).</p>\n</div>\n<div class=\"paragraph\">\n<p>Another part of Jenkins that was troublesome for reverse proxy users was the CLI.\nBesides the SSH protocol on port 22, which again was a hassle to open from the outside,\nthe CLI already had the ability to <a href=\"/blog/2017/04/11/new-cli/\">use HTTP(S) transport</a>.\nUnfortunately the trick used to implement that confused some proxies and was not very portable.\nJenkins 2.217 offers a new <code>-webSocket</code> CLI mode which should avoid these issues;\nagain you will need to download a new version of <code>jenkins-cli.jar</code> to use this mode.</p>\n</div>\n<div class=\"paragraph\">\n<p>The WebSocket code has been tested against a sample of Kubernetes implementations (including OpenShift),\nbut it is likely that some bugs and limitations remain,\nand scalability of agents under heavy build loads has not yet been tested.\nTreat this feature as beta quality for now and let us know how it works!</p>\n</div>","id":"bd7439b7-9ac0-59cd-a51c-c1739abb74ee","title":"WebSocket","date":"2020-02-02T00:00:00.000Z","slug":"/blog/2020/02/02/web-socket/","links":{"discourse":""},"authors":[{"avatar":null,"blog":null,"github":"jglick","html":"<div class=\"paragraph\">\n<p>Jesse has been developing Jenkins core and plugins for years.\nHe is the coauthor with Kohsuke of the core infrastructure of the Pipeline system.</p>\n</div>","id":"jglick","irc":null,"linkedin":null,"name":"Jesse Glick","slug":"/blog/authors/jglick","twitter":"tyvole"}]}},"pageContext":{"next":"/blog/2020/02/07/trip-to-dwjw/","previous":"/blog/2020/01/29/gsoc-report/","id":"bd7439b7-9ac0-59cd-a51c-c1739abb74ee"}},
    "staticQueryHashes": ["1271460761","3649515864"]}