Double-headed HTTP, via NodeJS.
Hydra makes it possible to:
- Make browser-initiated HTTP requests to the servers.
- Make server-initiated HTTP requests to browsers.
i.e. both the client and server can both make, and respond to, HTTP requests. In particular, HTTP clients running on the server can issue requests like
to a NodeJS-powered HTTP proxy, and have the request tunnelled to the browser via a WebSocket.
At this point, Hydra is mostly a proof of concept. HTTP requests can be passed back and forth, and there's simple browser-based code for both HTTP servers and HTTP clients. WebSocket-tunnelled HTTP requests can't be chunked or streamed (in either direction), though the client can respond out of order (because messages have an id).
This has been tested in Chrome and Firefox. Chrome supports WebSockets natively; Firefox requires a Flash "shim".
- Download and install NodeJS.
npm, install the
scyllapackages: $ curl http://npmjs.org/install.sh | sh # If you don't already have npm $ npm install socket.io $ npm install scylla
- Start the server: $ node demo.js External Httpd listening at http://127.0.0.1:8080/ Internal Proxy listening at http://127.0.0.1:8081/ 1 Aug 15:57:07 - socket.io ready - accepting connections
- Load http://127.0.0.1:8080/. (Using Google Chrome might be best.)
- You should see a page explaining how to:
- Initiate requests on the client
- Start a HTTP server on the client
Michael Stillwell email@example.com