Skip to content
/ ws Public
forked from websockets/ws

Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js

License

Notifications You must be signed in to change notification settings

SahidMiller/ws

 
 

Repository files navigation

@network-stackify/ws

Fork of ws package with opts.get and opts.createConnection

Usage

This is only required when shimming isn't a complete solution, for example, non-browser environments.

const https = require('@network-stackify/https');
const tls = require('@network-stackify/tls');
const net = require('@network-stackify/libp2p-net');

const ws = require('@network-stackify/ws');

const libp2p = createInstance(opts);
new ws('wss://endpoint.tld', {
  //Override native https.get (in ws)
  get: https.get,

  //Override native tls.connect
  createConnection: (opts) => {
    const socket = net.createConnection(opts);
    return tls.connect({ ...opts, socket });
  },

  //Options for net and tls
  libp2p,
  multiaddrs,
  hops,
  proto
});

About

Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%