websocket13
Advanced tools
Comparing version 1.2.0-beta1 to 1.2.0-beta2
@@ -7,3 +7,3 @@ /** | ||
var socket = new WS13.WebSocket('ws://127.0.0.1:8080', { | ||
var socket = new WS13.WebSocket('ws://echo.websocket.org', { | ||
"protocols": ["foo", "bar"] // supported subprotocols | ||
@@ -70,3 +70,1 @@ }); | ||
}); | ||
socket.on('debug', console.log); |
@@ -74,3 +74,3 @@ /** | ||
socket.on('debug', (msg) => { | ||
console.log(msg); | ||
//console.log(msg); | ||
}); | ||
@@ -77,0 +77,0 @@ |
@@ -177,3 +177,3 @@ var WS13 = require('./index.js'); | ||
if (++this._pingFailures >= this.options.pingFailures) { | ||
this._closeError(new Error("Ping timeout")); | ||
this._terminateError(WS13.StatusCode.PolicyViolation, "Ping timeout"); | ||
} else { | ||
@@ -635,10 +635,6 @@ this._queuePing(); | ||
WebSocketBase.prototype._terminateError = function(code, message) { | ||
var payload = new ByteBuffer(2 + message.length, ByteBuffer.BIG_ENDIAN); | ||
payload.writeUint16(code); | ||
payload.writeString(message || ""); | ||
this._sendControl(WS13.FrameType.Control.Close, payload.flip().toBuffer()); | ||
var err = new Error(message); | ||
err.state = this.state; | ||
err.code = code; | ||
this.disconnect(code, message); | ||
this.state = WS13.State.ClosingError; | ||
@@ -645,0 +641,0 @@ this.emit('error', err); |
{ | ||
"name": "websocket13", | ||
"version": "1.2.0-beta1", | ||
"version": "1.2.0-beta2", | ||
"description": "Simple WebSocket protocol 13 client with no native or heavy dependencies", | ||
@@ -5,0 +5,0 @@ "author": "Alexander Corn <mckay@doctormckay.com>", |
Sorry, the diff of this file is not supported yet
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
94375
1272