Support uWebSockets advanced http protocols(higher than HTTP/1.0)

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
networking

Research direction

Reproduce the failed handshake with uWebSockets and inspect websocket/src/handshake.cpp, especially lines 50-60 where the request is constructed. Trace why the server reports HTTP/1.0 incompatibility despite the logged HTTP/1.1 request, and verify that a client can complete the handshake and join the room without a 505 response.

Written by the indexing model from the issue text.

Description

Hello everyone!

I wanted to add uWebsockets to my colyseus server as the base transport and after doing so I've got this error on joining the room:

{ --[[0x7f664c38ba90]]
  event = 3,
  message = "Wrong response status: 505",
  handshake_response = { --[[0x7f664c38bc70]]
    status = 505,
    headers = { --[[0x7f664c38bef0]]
      Connection = "close"
    },
    response = "<h1>HTTP Version Not Supported</h1><p>This server does not support HTTP/1.0.</p><hr><i>uWebSockets/20 Server</i>"
  }
}

I'm not sure if it's related particulary to this extension, but I found that the actual request is constructed here, so I assume it's there.

Attaching debug messages from the extension-websocket:

WARNING:WEBSOCKET: STATE_CREATE -> STATE_CONNECTING
DEBUG:SCRIPT: proxy_unloaded
WARNING:WEBSOCKET: STATE_CONNECTING -> STATE_HANDSHAKE_WRITE
WARNING:WEBSOCKET: Sent buffer: 'GET ' 4 bytes
WARNING:WEBSOCKET: Sent buffer: '/T1H592Ase/477_pHQrM?sessionId=SORzU3p4R' 40 bytes
WARNING:WEBSOCKET: Sent buffer: ' HTTP/1.1\r\n' 11 bytes
WARNING:WEBSOCKET: STATUS: 'SendClientHandshake failed: PIPE'  len: 32
WARNING:WEBSOCKET: STATE_HANDSHAKE_WRITE -> STATE_DISCONNECTED
DEBUG:SCRIPT: [Colyseus] websocket error
DEBUG:SCRIPT: Connection error:,
{ --[[0x7fdac6faeca0]]
  event = 3,
  message = "SendClientHandshake failed: PIPE"
}
WARNING:WEBSOCKET: DestroyConnection: 0x56377ea273c0

Thanks in advance 🙏

Dominant language
C
Stars
51
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from defold/extension-websocket

All issues in defold/extension-websocket

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.