Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via pnpm

websocket-driver 0.7.4

WebSocket protocol handler with pluggable I/O
Package summary
Share
0
issues
2
licenses
2
MIT
2
Apache-2.0
Package created
4 May 2013
Version published
22 May 2020
Maintainers
1
Total deps
4
Direct deps
3
License
Apache-2.0

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
http-parser-js@0.5.8
safe-buffer@5.2.1

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
2 Packages, Including:
websocket-driver@0.7.4
websocket-extensions@0.1.4
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of websocket-driver 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
http-parser-js0.5.87.43 kBMIT
prod
safe-buffer5.2.19.74 kBMIT
prod
websocket-extensions0.1.415.33 kBApache-2.0
prod

Visualizations

Frequently Asked Questions

What does websocket-driver do?

WebSocket-Driver is an npm module that acts as an implementation of the WebSocket protocols and is capable of connecting to any I/O stream. The primary function is to simplify the WebSocket protocol interaction by taking care of the protocol details; this makes it easy for users to focus on building and implementing functionality that solely relies on data streaming, without being concerned about the intricacies of the protocol details.

How do you use websocket-driver?

The WebSocket-Driver module can be easily installed and incorporated into your project using the npm command npm install websocket-driver. After installation, it can used in a variety of scenarios, with examples given below:

Server-side with HTTP:

var http = require('http'),
    websocket = require('websocket-driver');

var server = http.createServer();

server.on('upgrade', function(request, socket, body) {
  if (!websocket.isWebSocket(request)) return;

  var driver = websocket.http(request);
  driver.io.write(body);
  socket.pipe(driver.io).pipe(socket);
  driver.messages.on('data', function(message) {
    console.log('Got a message', message);
  });

  driver.start();
});

Server-side with TCP:

var net = require('net'),
    websocket = require('websocket-driver');

var server = net.createServer(function(connection) {
  var driver = websocket.server();
  //... rest of the code
});

Client-side implementation:

var net = require('net'),
    websocket = require('websocket-driver');

var driver = websocket.client('ws://www.example.com/socket'),
    tcp = net.connect(80, 'www.example.com');

tcp.pipe(driver.io).pipe(tcp);
tcp.on('connect', function() {
  driver.start();
});
driver.messages.on('data', function(message) {
  console.log('Got a message', message);
});

For HTTP Proxies, Driver API and more, users can refer to the provided examples in the readme file on the Github repository of the module.

Where are the websocket-driver docs?

The full documentation and extensive details on the usage of WebSocket-Driver npm package are available provided directly within the readme on the official GitHub repository for this package. It contains examples of how to use the package in various scenarios along with insights on interacting with the driver API. To additional read documentation for WebSocket-Driver can follow the link git://github.com/faye/websocket-driver-node.git.