On Fri, Aug 23, 2013 at 2:58 AM, toddfas <todd...@gmail.com> wrote:

> I'm trying to figure out how to get access to the cookies and headers
> passed up in the Websocket handshake request on Tomcat 8.
>
> In Tomcat 7 the whole HttpServletRequest was passed into the
> WebSocketServlet. createWebSocketInbound method so it was easy to grab
> from the request headers. In Tomcat 8 the querystring and URI are both
> exposed by the javax.websocket.Session passed to
> ServerEndPoint.onOpen, but I don't see a mechanism for getting the
> cookies or headers.
>

You can supply an extension of
http://docs.oracle.com/javaee/7/api/javax/websocket/server/ServerEndpointConfig.Configurator.html
 and get
http://docs.oracle.com/javaee/7/api/javax/websocket/server/HandshakeRequest.html
through
modifyHandshake invoked by the container during processing of client 'GET'
handshake message. Handshake request containes methods for inspecting the
http request parameters and headers.



> We are integrating Websocket connections into an existing web app and
> want to use the cookies set by our web app in the Websocket connection
> process.
>
> Thanks for any insight.
> Todd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to