Spotlight on GF 4.1 - WebSocket Client Redirect

Written on September 15, 2014

A WebSocket connection is always initiated using HTTP (or HTTP/S). After a successful handshake, the HTTP connection is upgraded to a WebSocket connection using the HTTP 1.1 upgrade header.

Tyrus and GlassFish 4.1 now support HTTP 3xx Redirect handling during the WebSocket handhake phase. This feature allows a WebSocket server end-point to transparently redirect clients to another server end-point. Tyrus WebSocket client can be configured to accept to be redirected. The number of redirections allowed is also configurable (eg. to avoid infinite redirection loop). For more details on this feature, please check this section of the Tyrus documentation.

Originaly posted on The Aquarium blog.