Forum: NGINX Nginx Websocket proxy dropping frames

2974d09ac2541e892966b762aad84943?d=identicon&s=25 FlappySocks (Guest)
on 2014-04-24 23:30
(Received via mailing list)
Connecting to my websocket server directly works (Chrome or Firefox).
Connecting via the Nginx websocket proxy connects, but drops frames.
Here is
an example of the JSON messages:

<-- {"login" : { "username": "user", "password" : "pass"}}
--> {"loginReply" : { "state": "ok"}}
<-- {"someSetting1" : { "something": "something"}}
<-- {"someSetting2" : { "something": "something"}}  **DROPPED**
<-- {"someSetting3" : { "something": "something"}}  **DROPPED**

Those last three messages are sent immediately after login, but the last
two
don't make it to the websocket server (~90% of the time). Subsequent
messages, work fine, as if nothing was missing.

I have tried Nginx 1.4.7, 1.5.13 & 1.6

location /websocket {
            proxy_pass http://localhost:8001;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_read_timeout 86400;
}

I have tried proxy_buffering off and on.

Anything else I should try?

The problem occurs ~30% of the time on my powerful x86 machine, and ~90%
on
my two less powerful ARM machines (one is a Raspberry Pi, and the other
a
much faster dual core).

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249575,249575#msg-249575
1266aa99d1601b47bbd3ec22affbb81c?d=identicon&s=25 B.R. (Guest)
on 2014-04-25 00:14
(Received via mailing list)
Logs?
---
*B. R.*
2974d09ac2541e892966b762aad84943?d=identicon&s=25 FlappySocks (Guest)
on 2014-04-26 04:36
(Received via mailing list)
After analysing the data stream, Nginx is indeed streaming the data. The
difference is Nginx is buffering it into one continuous stream, where as
the
data from the browsers is fragmented.

The websocket implementation I was using needed fixing.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249575,249649#msg-249649
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.