New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

web6

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web6

Shim the "web" framework's `socketHandler` function for node.js v6.x

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

web6

Shim the "web" framework's socketHandler function for node.js v6.x

In theory, you can just add the digit 6 to your require('web') and it should work. If you know of any tests for "web" interface compatibility, please let me know so I can improve this shim to accomodate them.

Usage

from test/hello-server.js:

var web = require('web6'), makeApp = require('./hello-app.js'),
  app, appOpts = { greeting: 'Hello World!' },
  tcpServer = net.createServer(), tcpConnectionHandler;

if (cfg.announceExtras) {
  appOpts.greeting += ('\n\nWere you looking for one of these extras?\n' +
    cfg.announceExtras);
}

app = makeApp(appOpts);   // function (request, respond) { … }
if (cfg.addExtras) { app = cfg.addExtras(app); }

tcpConnectionHandler = web.socketHandler(app, { debug: true });
tcpServer.on('connection', tcpConnectionHandler);

tcpServer.on('listening', announceServerUrl(tcpServer));
tcpServer.listen(cfg.port, cfg.iface);

More examples:

License

ISC

Keywords

web

FAQs

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