websocket-stream
Advanced tools
Comparing version 0.5.0 to 0.5.1
var websocket = require('./') | ||
var elstreamo = require('el-streamo') | ||
ws = websocket('ws://localhost:8080', {type: Uint8Array}) | ||
ws = websocket('ws://localhost:8080') | ||
var elstream = elstreamo.writable('#messages') | ||
ws.on('data', function(c) { console.log({foo: c}) }) | ||
ws.pipe(elstream) |
@@ -22,3 +22,4 @@ var through = require('through') | ||
} else { | ||
this.ws = new WebSocketPoly(server, this.options) | ||
var opts = (process.title === 'browser') ? this.options.protocol : this.options | ||
this.ws = new WebSocketPoly(server, opts) | ||
this.ws.binaryType = this.options.binaryType || 'arraybuffer' | ||
@@ -39,4 +40,4 @@ this.ws.onmessage = this.onMessage.bind(this) | ||
var data = e | ||
if (data.data) data = data.data | ||
if (typeof data.data !== 'undefined') data = data.data | ||
// type must be a Typed Array (ArrayBufferView) | ||
@@ -43,0 +44,0 @@ var type = this.options.type |
{ | ||
"name": "websocket-stream", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "websockets with the node stream api. works in browser and node", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
11687
218