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

websocket

Package Overview
Dependencies
Maintainers
0
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json

@@ -6,3 +6,3 @@ {

"author": "Brian McKelvey <brian@worlize.com>",
"version": "0.0.1",
"version": "0.0.2",
"repository": {

@@ -9,0 +9,0 @@ "type": "git",

@@ -6,2 +6,4 @@ WebSocket Client & Server Implementation for Node

**Note about FireFox 6: Firefox 6 re-enables support for WebSockets by default. It uses a prefixed constructor name, MozWebSocket(), to avoid conflicting with already deployed scripts. It also implements draft-07, so if you want to target Firefox 6, you will need to checkout my draft-07 branch, not the latest one.**
Overview

@@ -21,2 +23,15 @@ --------

Installation
------------
In your project root:
$ npm install websocket
Then in your code:
var WebSocketServer = require('websocket').server;
var WebSocketClient = require('websocket').client;
var WebSocketFrame = require('websocket').frame;
var WebSocketRouter = require('websocket').router;
Current Features:

@@ -55,3 +70,3 @@ -----------------

#!/usr/bin/env node
var WebSocketServer = require('../lib/WebSocketServer');
var WebSocketServer = require('websocket').server;
var http = require('http');

@@ -96,3 +111,3 @@

#!/usr/bin/env node
var WebSocketClient = require('../lib/WebSocketClient');
var WebSocketClient = require('websocket').client;

@@ -99,0 +114,0 @@ var client = new WebSocketClient();

@@ -75,2 +75,4 @@ #!/usr/bin/env node

var mirrorHistory = [];
router.mount('*', 'lws-mirror-protocol', function(request) {

@@ -81,6 +83,24 @@ // Should do origin verification here. You have to pass the accepted

console.log((new Date()) + " lws-mirror-protocol connection accepted from " + connection.remoteAddress);
console.log((new Date()) + " sending mirror protocol history to client " + connection.remoteAddress);
if (mirrorHistory.length > 0) {
connection.sendUTF(mirrorHistory.join(''));
}
mirrorConnections.push(connection);
connection.on('message', function(message) {
// We only care about text messages
if (message.type === 'utf8') {
// Clear canvas command received
if (message.utf8Data === 'clear;') {
mirrorHistory = [];
}
else {
// Record all other commands in the history
mirrorHistory.push(message.utf8Data);
}
// Re-broadcast the command to all connected clients
mirrorConnections.forEach(function (outputConnection) {

@@ -91,2 +111,4 @@ outputConnection.sendUTF(message.utf8Data);

});
connection.on('close', function(connection) {

@@ -129,2 +151,2 @@ var index = mirrorConnections.indexOf(connection);

console.log("libwebsockets-test-server protocols.");
console.log("Point your draft-07 complant browser to http://localhost:" + args.port + "/");
console.log("Point your draft-09 complant browser to http://localhost:" + args.port + "/");

@@ -620,5 +620,5 @@ /*

wuint32(value[0], endian, buffer, offset);
wuint32(value[1], endian, buffer, offset+3);
wuint32(value[1], endian, buffer, offset+4);
} else {
wuint32(value[0], endian, buffer, offset+3);
wuint32(value[0], endian, buffer, offset+4);
wuint32(value[1], endian, buffer, offset);

@@ -625,0 +625,0 @@ }

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