Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 29, 2024 via pnpm

websocket 1.0.34

Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.
Package summary
Share
3
issues
3
high severity
meta
3
3
licenses
10
MIT
7
ISC
1
Apache-2.0
Package created
5 Jul 2011
Version published
14 Apr 2021
Maintainers
1
Total deps
18
Direct deps
6
License
Apache-2.0

Issues

3

3 high severity issues

high
via: bufferutil@4.0.8
via: es5-ext@0.10.64
via: utf-8-validate@5.0.10
Collapse
Expand

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
10 Packages, Including:
bufferutil@4.0.8
debug@2.6.9
es6-iterator@2.0.3
event-emitter@0.3.5
is-typedarray@1.0.0
ms@2.0.0
node-gyp-build@4.8.0
typedarray-to-buffer@3.1.5
utf-8-validate@5.0.10
yaeti@0.0.6

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
7 Packages, Including:
d@1.0.2
es5-ext@0.10.64
es6-symbol@3.1.4
esniff@2.0.1
ext@1.7.0
next-tick@1.1.0
type@2.7.2

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
1 Packages, Including:
websocket@1.0.34
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

6
All Dependencies CSV
β“˜ This is a list of websocket 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
bufferutil4.0.8158.33 kBMIT
prod
1
debug2.6.916.13 kBMIT
prod
es5-ext0.10.64365.2 kBISC
prod
1
typedarray-to-buffer3.1.53.67 kBMIT
prod
utf-8-validate5.0.10155.32 kBMIT
prod
1
yaeti0.0.63.34 kBMIT
prod

Visualizations

Frequently Asked Questions

What does websocket do?

The package "websocket" is a client and server library that implements the WebSocket protocol as per RFC 6455 specification. This allows real-time communication between a client and a server. The JavaScript implementation is designed to work with Node.js and supports the WebSocket protocol versions 8 and 13. It's capable of handling and aggregating received fragmented messages, fragmenting outgoing messages, tuning settings and more. It also supports a W3C WebSocket API for applications running on both Node and browsers.

How do you use websocket?

To use the "websocket" package, you first need to install it using npm with the command npm install websocket executed in your project root. You can then require it in your code using var WebSocketServer = require('websocket').server;.

Here's an example of how to set up a simple WebSocket server:

var WebSocketServer = require('websocket').server;
var http = require('http');

var server = http.createServer(function(request, response) {
    console.log((new Date()) + ' Received request for ' + request.url);
    response.writeHead(404);
    response.end();
});

server.listen(8080, function() {
    console.log((new Date()) + ' Server is listening on port 8080');
});

wsServer = new WebSocketServer({
    httpServer: server,
    autoAcceptConnections: false
});

wsServer.on('request', function(request) {
    var connection = request.accept('echo-protocol', request.origin);
    console.log((new Date()) + ' Connection accepted.');
    connection.on('message', function(message) {
        if (message.type === 'utf8') {
            connection.sendUTF(message.utf8Data);
        }
    });
    connection.on('close', function(reasonCode, description) {
        console.log((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.');
    });
});

This code creates an HTTP server and associates a new WebSocketServer with it, listening on port 8080.

Where are the websocket docs?

The detailed API documentation for the "websocket" package can be found in the docs folder on the GitHub repository. The link is here: git+https://github.com/theturtle32/WebSocket-Node/docs/index.md. It provides comprehensive information about the WebSocket Client, Server Implementation for Node with various examples and use-cases.