Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hydra

Package Overview
Dependencies
Maintainers
0
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hydra

Double-headed HTTP: allow both clients and servers to issue HTTP requests

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
470
increased by16.92%
Maintainers
0
Weekly downloads
 
Created
Source

Hydra

Double-headed HTTP, via NodeJS.

Introduction

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

DELETE http://client16b759c4/item/78

to a NodeJS-powered HTTP proxy, and have the request tunnelled to the browser via a WebSocket.

Status/TODO

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".

Demo

  1. Download and install NodeJS.
  2. With npm, install the socket.io scylla packages: $ curl http://npmjs.org/install.sh | sh # If you don't already have npm $ npm install socket.io $ npm install scylla
  3. 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
  4. Load http://127.0.0.1:8080/. (Using Google Chrome might be best.)
  5. You should see a page explaining how to: * Initiate requests on the client * Start a HTTP server on the client

Author

Michael Stillwell mjs@beebo.org

FAQs

Package last updated on 24 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc