I have a website hosted on lighttpd, accessible at the "www" subdomain. I also have a chat server listening on port 8124 made with node.js and socket.io.
I want all client traffic to happen on port 80, by redirecting all requests to the "chat" subdomain to port 8124. So I enabled mod_proxy and in lighttpd.conf I added:
$HTTP["host"] == "chat.myserver.com" {
proxy.server = (
"" => ((
"host" => "78.128.79.192",
"port" => "8124"
))
)
}
On the client, when I connect to the websocket,
var socket = io.connect('http://chat.myserver.com');
I get the right messages from node.js:
debug - client authorized
info - handshake authorized 6067470561567883577
debug - setting request GET /socket.io/1/websocket/6067470561567883577
debug - set heartbeat interval for client 6067470561567883577
debug - client authorized for
debug - websocket writing 1::
But the browser gives an error:
Firefox can't connect to server ws://chat.myserver.com/socket.io/1/websocket/6067470561567883577
Of course, everything works correctly if I connect directly to the port 8124:
var socket = io.connect('http://www.myserver.com:8124');
But, as I said, I would like all client traffic to be on port 80. Is it possibile?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…