Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Setting TOS/DS for WebSocket traffic

Hi,

I'm using Jetty 9.1.1 as websocket client & server over SSL, and need to set the TOS / DF fields (RFC 1349 / RFC 2474) on the generated TCP traffic in order for it to be routed with the same level of priority as the associated non-websocket traffic it controls (currently Express Forwarding, but others might be used depending on the environment).

I've had a look around, but couldn't find an easy way to configure it for the socket/channels created by either the Server or the WebSocketClient. The nearest thing I've found is the configuration of another socket options (lingerTime) for server sockets, but not much of the WebSocketPolicy applies to the creation of client sockets.

The only way I currently managed to do that is through rather ugly hacks: - On the server side, subclass oejs.ServerConnector and override protected void configure(Socket) in order to call socket.setTrafficClass(tos). I could live with that. - On the client side, subclass oejwci.ConnectionManager, override public ConnectPromise connect(WebSocketClient, EventDriver, ClientUpgradeRequest), and return a class similar to PhysicalConnect which would either call channel.socket().setTrafficClass(tos) or channel.setOption(StandardSocketOptions.IP_TOS, tos) before connecting. This is much uglier due to the private PhysicalConnect inner class and its lack of socket configuration hooks.

Did I miss something ? Is there an easier way to configure that option ?

If not, would you consider making this configurable in a later version ?

Regards,

Xavier BRUGGHEMAN


Back to the top