mod_websocket
mod_websocket copied to clipboard
lighttpd 1.4.39: updated tentative patch for Websocket proxy
- Don't read '\0' character from client when forwarding data to proxy backend.
- Don't add extra '\0' character to client buffer. It is already included in buffer_append_string_len.
The next version of lighttpd (to be lighttpd 1.4.46) adds support for mod_proxy to recognize Upgrade: websocket and to act as transparent proxy. (https://github.com/lighttpd/lighttpd1.4/)
I began porting this @nori0428 mod_websocket implementation to lighttpd 1.4.46, but paused when I noticed that the MOD_WEBSOCKET_WEBSOCKET_PROXY mode (websocket.server "proto" => "websocket") was already supported in lighttpd 1.4.46 mod_proxy.
What are the benefits of MOD_WEBSOCKET_TCP_PROXY (websocket.server "proto" => "tcp")? That mode appears to use websockets from the client to encapsulate another (unspecified) protocol between the client and the backend. Do you know of any examples using this? (I am aware of sample/bin/echo.rb and the reference you gave to #28 for mosquitto)
While the backend could run a simple websocket server and handle these requests if the TCP proxy mode was not available, the TCP proxy mode of websocket gateway could be used to send arbitrary commands and receive arbitrary output from the target backend, without the backend needing to understand websockets. Is this the primary purpose of mod_websocket TCP mode?
That mode appears to use websockets from the client to encapsulate another (unspecified) protocol between the client and the backend. Do you know of any examples using this?
Example use case: VNC server <-> Javascript VNC client that uses websockets such as noVNC. https://github.com/novnc/noVNC
lighttpd git master (https://github.com/lighttpd/lighttpd1.4/) now contains a new module, mod_wstunnel which acts as a websocket tunnel endpoint, forwarding the decoded data to a backend socket server. I would be interested in getting feedback if this works for you with noVNC. Thanks.
With commit 513e407b064ea169241e019e5b9d92d5d905a856 to https://github.com/lighttpd/lighttpd1.4/ I believe https://github.com/nori0428/mod_websocket/ is obsolete. I posted a simple config for using noVNC with lighttpd and x11vnc to https://redmine.lighttpd.net/boards/2/topics/7600