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

http-auth2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-auth2

HTTP server with basic authentication.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

http-auth

HTTP server with basic authentication.

Installation

Via git (or downloaded tarball):

$ git clone git://github.com/SDA/http-auth2.git

Via npm:

$ npm install http-auth2

Usage

var httpAuth = require('http-auth2');
httpAuth.createServer(function(username) {
	// Multiple username/password combinations are supported.
	if (username == 'user1') return 'password1';
	if (username == 'user2') return 'password2';
	return false;
}, function (request, response) {
	response.writeHead(200, {'Content-Type': 'text/html'});
	response.end("<pre>If you can read this, you've authenticated successfully.</pre>");
}).listen(8000);

Server startup params

  • auth - Authentication callback that accepts a username and returns the password for that user, or false if that user account is invalid.
  • callback - Callback function that will be called after server starts.

Acknowledgments

Based on work by Gevorg Harutyunyan: https://github.com/gevorg/http-auth

License

The GPL version 3, read it at http://www.gnu.org/licenses/gpl.txt

Keywords

FAQs

Package last updated on 25 Sep 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