I’ve implemented the WebSocket wire protocol as an incremental parser,
suitable for use in high-end asynchronous servers such as NGINX. The
open source (BSD-licenced) and available on GitHub1. I plan on using
tunnel other protocols (svn and git, in particular) over HTTP. I have a
setup that works well on the client side, but I’d like to integrate this
existing NGINX stack with includes virtual hosting and a bunch of other
can’t use another server directly unless I use a non-default port).
To the best of my understanding, NGINX has no support for WebSockets.
proxy module does not support HTTP 1.1 and WebSockets are incompatible
SCGI and FastCGI because of the “Content-Length” problem (it is assumed
to be 0
I’d like to implement an NGINX module that specifically handles
that I can integrate my tunnel in my NGINX setup. I have absolutely no
experience with the NGINX source code, but I’ve found a nice guide on
NGINX modules. After initial reading, I understand that I need to
Upstream (proxy) handler. Is this correct?
The HTTP proxy module has a scary note that says:
Note that when using the HTTP Proxy Module (or even when using FastCGI), the
entire client request will be buffered in nginx before being passed on
backend proxied servers.
Is this a limitation cause by NGINX’s architecture, or is this by design
(e.g. for validation of body against headers, etc.)?
The bigger problem, however, is that there is no standard interface to
application servers for this new WebSocket protocol. There is some
discussion on an Apache enhancement request that basically proposes a
modification of CGI. Since CGI has already been demonstrated to be a
performance problem, I’m looking for an alternate solution, maybe
closer to SCGI? Anyone have suggestions?