websocket-stream
Advanced tools
Comparing version 5.1.1 to 5.1.2
{ | ||
"name": "websocket-stream", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"license": "BSD-2-Clause", | ||
@@ -5,0 +5,0 @@ "description": "Use websockets with the node streams API. Works in browser and node", |
@@ -18,12 +18,2 @@ 'use strict' | ||
proxy._destroy = function(err, cb) { | ||
var self = this | ||
this.push(null) | ||
this.end() | ||
process.nextTick(function() { | ||
cb(err); | ||
self.emit('close') | ||
}) | ||
} | ||
return proxy | ||
@@ -110,3 +100,3 @@ } | ||
if (coerceToBuffer && typeof chunk === 'string') { | ||
chunk = new Buffer(chunk, 'utf8') | ||
chunk = Buffer.from(chunk, 'utf8') | ||
} | ||
@@ -123,3 +113,3 @@ socket.send(chunk, next) | ||
if (coerceToBuffer && typeof chunk === 'string') { | ||
chunk = new Buffer(chunk, 'utf8') | ||
chunk = Buffer.from(chunk, 'utf8') | ||
} | ||
@@ -126,0 +116,0 @@ |
@@ -5,2 +5,3 @@ var http = require('http') | ||
var WebSocketServer = require('ws').Server | ||
var Buffer = require('safe-buffer').Buffer | ||
@@ -48,5 +49,5 @@ echo.start(function(){ | ||
if (!Buffer.isBuffer(data)) { | ||
ws.send(new Buffer('fail')) | ||
ws.send(Buffer.from('fail')) | ||
} else { | ||
ws.send(new Buffer('success')) | ||
ws.send(Buffer.from('success')) | ||
} | ||
@@ -53,0 +54,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22598
552