Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Jun 17, 2024 via pnpm

websocket 1.0.30

Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.
Package summary
Share
1
issue
1
high severity
meta
1
2
licenses
6
MIT
1
Apache-2.0
Package created
5 Jul 2011
Version published
12 Sep 2019
Maintainers
1
Total deps
7
Direct deps
4
License
Apache-2.0

Issues

1

1 high severity issue

high
via: websocket@1.0.30
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
6 Packages, Including:
debug@2.6.9
is-typedarray@1.0.0
ms@2.0.0
nan@2.20.0
typedarray-to-buffer@3.1.5
yaeti@0.0.6

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.30
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

4
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
debug2.6.916.13 kBMIT
prod
nan2.20.0420.04 kBMIT
prod
typedarray-to-buffer3.1.53.67 kBMIT
prod
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.