<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Would it help if i supplied a gist (written in Scala)?<div><br><div><div>Am 26.06.2011 um 23:24 schrieb Marc Hämmerle:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">When haproxy is used in http-mode it splits incoming upgrade-requests for websockets as the nonce (8 byte) in the body of the request is not http-compliant. The Server then acknowledges that he's indeed capable of handling websockets, replies with the first part of the response-header and handles the nonce and second part of the response-header afterwards (working Python/Tornado solution:&nbsp;<a href="http://groups.google.com/group/python-tornado/browse_thread/thread/fdc3d62c5b3725aa">http://groups.google.com/group/python-tornado/browse_thread/thread/fdc3d62c5b3725aa</a>).<div><br></div><div>The problem - besides a totally broken WebSocket 76 spec - is that netty won't decode(via the HttpRequestDecoder in the pipeline) the incoming http request when the nonce is not present; in my handler just the handler for the channel connect is called, but not the handler for received messages - so the connection times out.</div><div><br></div><div>This works (as far as netty is concerned):</div><div><div><br></div><div># request begin</div><div>GET /ws/ HTTP/1.1</div><div>Upgrade: WebSocket</div><div>Connection: Upgrade</div><div>Host: localhost</div><div>Origin: <a href="http://localhost/">http://localhost</a></div><div>Sec-WebSocket-Key1: 290 &nbsp;q =2 9y 7,41 &nbsp;t &nbsp; q #18U</div><div>Sec-WebSocket-Key2: 56 &nbsp;4} 61 494 &nbsp;6</div><div><br></div><div>12345678</div></div><div># request end</div><div><br></div><div>but this doesn't work:</div><div><br></div><div><div><div># request begin</div><div>GET /ws/ HTTP/1.1</div><div>Upgrade: WebSocket</div><div>Connection: Upgrade</div><div>Host: localhost</div><div>Origin: <a href="http://localhost/">http://localhost</a></div><div>Sec-WebSocket-Key1: 290 &nbsp;q =2 9y 7,41 &nbsp;t &nbsp; q #18U</div><div>Sec-WebSocket-Key2: 56 &nbsp;4} 61 494 &nbsp;6</div><div><br></div><div><br></div></div><div># request end</div></div><div><br></div><div><br></div><div>Can anybody point me in the right direction to solve this, without implementing a HttpRequestDecoder from the ground up? Is this a bug or is it intended behaviour?</div><div><br></div><div><br></div><div>Cheers.</div></div>_______________________________________________<br>netty-users mailing list<br><a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/netty-users">https://lists.jboss.org/mailman/listinfo/netty-users</a></blockquote></div><br></div></body></html>