Search code examples
websocketjettyjetty-9java-websocket

How do I create a Multiplexed WebSocket connection in Jetty 9.2.2?


I currently have a WebSocket connection where a web client connects to my Jetty server and streams results back. It uses the standard Java Jetty websocket api and works beautifully.

Well I'm at the point now where I'd like a user to be able to stream data for dozens of simultaneous streams without hitting a browser limit and would thus like to multiplex these connections. I've come across a handful of ways to do this in JavaScript but the only method I've found for Jetty is the websocket-mux-extension. The latest version of this extension that I've found is roughly 3 years old and when I attempted to use it with Jetty 9.2.2 it looks like it has incompatibilities (at least with the OutgoingFrames interface in the websocket API).

I'm fairly new to WebSockets so I'm sure this is based on my lack of understanding but this feels like this would be a common problem to solve and it seems suspicious that this capability is no longer being maintained. Is there an alternative way to multiplex these websocket streams or is there a reason I shouldn't be doing this?


Solution

  • websocket mux extension was a draft (proposed) extension at the IETF.

    It never amounted to anything and was abandoned in favor of HTTP/2 and its eventual WebSocket support.

    There is currently no websocket mux support anywhere.