users@grizzly.java.net

WebSockets accessing request and response headers.

From: Richard Zschech <richard.zschech_at_velsys.com>
Date: Mon, 27 Sep 2010 13:41:55 +0930

Hi,

 

I'm looking at the latest WebSockets code linked from here and have a
few questions:
http://blogs.sun.com/oleksiys/entry/grizzly_2_0_websockets_support

 

How do I access the HTTP request and response headers? Surely I should
be able to access the cookie information.

 

How do I establish a HTTP session when a WebSocket requests is received?
Surely I should be able to do this.

 

WebKit sets the cookie headers correctly:

 

http://trac.webkit.org/browser/trunk/WebCore/websockets/WebSocketHandsha
ke.cpp#L275

http://trac.webkit.org/browser/trunk/WebCore/websockets/WebSocketHandsha
ke.cpp#L565

 

Perhaps the WebSocketApplication should get a HttpServletRequest and
HttpServletResponse as parameters to the createWebSocket method?

 

 

Also how do I do non-blocking writes/sends? I would like to be notified
when a non-blocking write is available before actually sending my data.
I need this to minimise the latency through the network and to ensure
that slow browser connections are not blocking the processing of fast
browser connections.

 

Thanks in advance for your help,

From Richard.