defold / defold/extension-websocket

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

Open
#61 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
50
Forks
17
Avg merge
20h 9m
Merged PRs (30d)
1

Description

Hello everyone!

I wanted to add [uWebsockets](https://docs.colyseus.io/server/transport/uwebsockets) to my colyseus server as the base transport and after doing so I've got this error on joining the room:
```lua
{ --[[0x7f664c38ba90]]
event = 3,
message = "Wrong response status: 505",
handshake_response = { --[[0x7f664c38bc70]]
status = 505,
headers = { --[[0x7f664c38bef0]]
Connection = "close"
},
response = "

HTTP Version Not Supported

This server does not support HTTP/1.0.


uWebSockets/20 Server"
}
}
```

I'm not sure if it's related particulary to this extension, but I found that the actual request is constructed [here](https://github.com/defold/extension-websocket/blob/master/websocket/src/handshake.cpp#L50-L60), so I assume it's there.

Attaching debug messages from the extension-websocket:
```bash
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 🙏

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.