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

httpu

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpu

HTTP over Unix Domain Sockets

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

node-httpu is a very small library that enables you to make http client requests over a Unix Domain Socket. Arguably, this code should be in node core, but for the time being, it's not.

Usage

The library is very simple, and small, and only exposes you the ability to create a new fd socket that can be used with the existing node net API:

var httpu = require('httpu');

var options = {
  socketPath: '/tmp/httpu-sock',
  path: '/index.html'
};

var req = httpu.get(options, function(res) {
  console.log('STATUS: ' + res.statusCode);
  console.log('HEADERS: ' + JSON.stringify(res.headers));
  res.setEncoding('utf8');
  res.on('data', function (chunk) {
    console.log('BODY: ' + chunk);
  });
}).on('error', function(e) {
  console.log("Got error: " + e.message);
});

This is just a direct overlay on top of the HTTP binding, except you can specify a socketPath as opposed to host:port.

Installation

npm install httpu

License

MIT.

Bugs

See https://github.com/mcavage/node-httpu/issues.

FAQs

Package last updated on 24 Apr 2011

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