#1984 mod_websocket doesn't work behind a lighttpd reverse proxy
Reporter
Christof Meerwald
Owner
Nobody
Created
Updated
Stars
★★ (2)
Tags
Priority-Medium
Status-New
Type-Defect
Christof Meerwald
on
What steps will reproduce the problem?
1. Configure lighttpd with mod_proxy ("upgrade" => "enable") to connect to prosody's websocket port
2. Try to connect via that websocket connection
What is the expected output?
Client is able to use connect via websockets
What do you see instead?
prosody immediately closes the websocket connection
What version of the product are you using? On what operating system?
0.12.4-1build3 (Ubuntu 24.04)
Please provide any additional information below.
It looks like that lighttpd adds a "Connection: close, upgrade" header to the initial HTTP request to prosody which causes prosody to immediately close the connection (after sending the initial "Upgrade" response).
see https://github.com/lighttpd/lighttpd1.4/blob/master/src/mod_proxy.c#L1051 and https://hg.prosody.im/trunk/file/tip/net/http/server.lua#l251
It's not entirely clear to me what the HTTP spec says for these situations, but it would be nice if this would work.
What steps will reproduce the problem? 1. Configure lighttpd with mod_proxy ("upgrade" => "enable") to connect to prosody's websocket port 2. Try to connect via that websocket connection What is the expected output? Client is able to use connect via websockets What do you see instead? prosody immediately closes the websocket connection What version of the product are you using? On what operating system? 0.12.4-1build3 (Ubuntu 24.04) Please provide any additional information below. It looks like that lighttpd adds a "Connection: close, upgrade" header to the initial HTTP request to prosody which causes prosody to immediately close the connection (after sending the initial "Upgrade" response). see https://github.com/lighttpd/lighttpd1.4/blob/master/src/mod_proxy.c#L1051 and https://hg.prosody.im/trunk/file/tip/net/http/server.lua#l251 It's not entirely clear to me what the HTTP spec says for these situations, but it would be nice if this would work.