openresty / lua-resty-websocket

WebSocket support for the ngx_lua module (and OpenResty)
505 stars 106 forks source link

bad RSV1, RSV2, or RSV3 bits #44

Open sdmrnv opened 5 years ago

sdmrnv commented 5 years ago

When I GET the address that call lua script with client example I receive error: "failed to receive the frame: bad RSV1, RSV2, or RSV3 bits"

nginx.conf:

server{ listen 80; server_name comet.io; location /cli{ default_type 'text/html'; content_by_lua_file 'path/to/lua/ws_client.lua'; } }

ws_client.lua: <copy-paste from https://github.com/openresty/lua-resty-websocket#restywebsocketclient>

curl http://comet.io/cli failed to receive the frame: bad RSV1, RSV2, or RSV3 bits

There is my ws server config:

server {
listen 8020;
    server_name comet.io;
    location /ser {
        proxy_pass http://comet.io:8010;
        proxy_http_version 1.1;
        proxy_set_header Upgrade "websocket";
        proxy_set_header Connection "Upgrade";
        proxy_set_header sec-websocket-key tfyt7uhy08yuh08909uoij;
        proxy_set_header sec-websocket-version 13;
    }
}

server {
    listen 8010;
    server_name comet.io;

    location /ser {
        default_type 'text/html';
        content_by_lua_file '/root/ws_server.lua';
    }
}
KamranBiglari commented 2 years ago

@sdmrnv Have you find a solution to fix this problem, I have same problem when I tried to connect to wss://ws.kraken.com/book