Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

websocket13

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket13 - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

6

examples/echoserver.js

@@ -8,3 +8,3 @@ /**

var webserver = require('http').createServer(function(req, res) {
res.statusCode = 403;
res.writeHead(403, {"Content-Type": "text/html"});
res.end("<html><body><h1>Forbidden</h1>This server only accepts WebSocket connections.</body></html>");

@@ -77,2 +77,6 @@ });

});
socket.on('latency', (time) => {
console.log("Client from " + socket.handshakeData.remoteAddress + " has latency: " + time + " ms");
});
});

@@ -150,2 +150,3 @@ var WS13 = require('./index.js');

this._pingValue = bytes.readUInt32BE(0);
this._pingTime = Date.now();

@@ -313,2 +314,3 @@ this._sendFrame({

if (frame.payload && frame.payload.length == 4 && frame.payload.readUInt32BE(0) == this._pingValue) {
this.emit('latency', Date.now() - this._pingTime);
this._pingFailures = 0;

@@ -315,0 +317,0 @@ this._queuePing();

@@ -65,2 +65,3 @@ var WS13 = require('./index.js');

this.headers['sec-websocket-version'] = WEBSOCKET_VERSION;
this.headers['user-agent'] = this.headers['user-agent'] || "node.js/" + process.versions.node + " (" + process.platform + " " + require('os').release() + " " + require('os').arch() + ") node-websocket13/" + require('../package.json').version;

@@ -67,0 +68,0 @@ if (this.options.protocols) {

@@ -221,2 +221,4 @@ var WS13 = require('./index.js');

}
this.emit('connected'); // perform connect tasks
}

2

package.json
{
"name": "websocket13",
"version": "1.1.0",
"version": "1.1.1",
"description": "Simple WebSocket protocol 13 client with no native or heavy dependencies",

@@ -5,0 +5,0 @@ "author": "Alexander Corn <mckay@doctormckay.com>",

@@ -9,4 +9,4 @@ # WebSockets for Node.js

This is a pure-JavaScript implementation of [WebSockets version 13](https://tools.ietf.org/html/rfc6455).
It has only one lightweight dependency. Presently it can only establish connections to WebSocket servers (as a client),
but server support is [planned](#planned-features).
It has only one lightweight dependency. It can establish connections to WebSocket servers (as a client), and also accept
connections from clients (as a server).

@@ -13,0 +13,0 @@ **Requires node.js v4.0.0 or later.**

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc