openresty / openresty/lua-resty-websocket

bad RSV1, RSV2, or RSV3 bits

Open
#44 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
523
Forks
112
Avg merge
1d 16m
Merged PRs (30d)
2

Description

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';
    }
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the error with the shown curl request and reviewing nginx.conf, ws_client.lua, and ws_server.lua, including the referenced lua-resty-websocket client example. Trace the WebSocket handshake and frame exchange to determine which configuration or endpoint produces the invalid RSV bits; done means a confirmed cause and a reproducible correction or clear explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.