Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misultin websocket hixie76 implementation doesn't work behind haproxy #98

Open
majek opened this issue Feb 9, 2012 · 2 comments
Open

Comments

@majek
Copy link

majek commented Feb 9, 2012

Similar bugs:

In order to get Hixie76 through a HAProxy loadbalancer the server must send response headers before the request nonce is received. In other words: before haproxy will send the extra data from the client (nonce) it expects the server to respond to the headers. Current implementation does not support that, and hangs and waits for nonce instead of sending response headers as soon as possible.

To reproduce: https://gist.github.com/1780761

  1. chmod +x ./misultin_haproxy_bug.erl
    ./misultin_haproxy_bug.erl
  2. node client-direct.js ## That works fine, as all ws handshake is sent in one go
  3. node client-haproxy.js ## That hangs for 200ms and quits, as nonce is send only once headers are received. This is wrong.

(Sorry for writing tests in node, but the logic is quite simple.)

Another way to reproduce:

  1. ./misultin_haproxy_bug.erl
  2. run nc localhost 8000 and paste:
GET /demo HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: example.com
Origin: http://example.com
Sec-WebSocket-Key1: 4 @1  46546xW%0l 1 5
Sec-WebSocket-Key2: 12998 5 Y3 1  .P00

Result: server hangs. Expected result: response headers (without nonce yet). Response nonce should be sent once next 8 bytes are sent by the client.

@ostinelli
Copy link
Owner

thank you for this.

misultin has been discontinued, my reasons here.

r.

@timclassic
Copy link

See Gist timclassic/5287161 for a patch that fixes this issue. I'm using this patch internally and it has solved my issues with HAProxy and Flash sockets (which use hixie76).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants