npm

Need private packages and team management tools?Check out npm Orgs. »

sni-reader

0.1.1 • Public • Published

sni-reader

Version npmnpm DownloadsBuild StatusCoverage StatusDependenciesTips

sni-reader extracts the Server Name Indication from a raw TLS stream. It reads the ClientHello message and extracts the value of the SNI extension if the extension is present.

Usage

var net = require('net')
var sni = require('sni-reader')
 
const serverNameMap =
  { 'example.com': 8001
  , 'example.net': 8002
  }
 
net.createServer(function(socket) {
  sni(socket, function(err, serverName) {
    const port = serverNameMap[serverName]
    socket.pipe(net.connect(port)).pipe(socket)
  })
}).listen(80)

Install

npm install -S sni-reader

License

MIT

install

npm i sni-reader

Downloadsweekly downloads

2

version

0.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability