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

ws-messaging

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ws-messaging - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="0.7.2"></a>
## [0.7.2](https://github.com/an-sh/ws-messaging/compare/v0.7.1...v0.7.2) (2017-01-19)
### Bug Fixes
* actually fix async receiveHook handling ([66934c9](https://github.com/an-sh/ws-messaging/commit/66934c9))
<a name="0.7.1"></a>

@@ -7,0 +17,0 @@ ## [0.7.1](https://github.com/an-sh/ws-messaging/compare/v0.7.0...v0.7.1) (2017-01-17)

6

lib/Client.js

@@ -202,3 +202,5 @@ 'use strict';

}).then(function () {
if (_this3.receiveHook) _this3.receiveHook(message);
if (_this3.receiveHook) {
return _this3.receiveHook(message);
}
}).then(function () {

@@ -514,2 +516,2 @@ return _this3._dispatch(message);

module.exports = Client;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9DbGllbnQuanMiXSwibmFtZXMiOlsiRXZlbnRFbWl0dGVyIiwicmVxdWlyZSIsImFzc2lnbiIsImF0dGVtcHQiLCJmcm9tQ2FsbGJhY2siLCJQcm9taXNlIiwiYmxhY2tsaXN0IiwiY29uY2F0IiwiYmluZCIsImVtaXQiLCJwcm90b3R5cGUiLCJpc0JsYWNrbGlzdGVkRXZlbnQiLCJuYW1lIiwiaW5kZXhPZiIsImdldE93blByb3AiLCJvYmoiLCJoYXNPd25Qcm9wZXJ0eSIsInVuZGVmaW5lZCIsIkNvbm5lY3Rpb25FcnJvciIsImlkIiwiT2JqZWN0IiwiY3JlYXRlIiwiRXJyb3IiLCJUaW1lb3V0RXJyb3IiLCJOb1Byb2NlZHVyZUVycm9yIiwicHJvY2VkdXJlIiwidmF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XMuc29ja2V0LmNsb3NlKGNvZGUsIHN0cikgfVxuICAgIH1cbiAgfVxufVxuXG4vKipcbiAqIEFsaWFzIGZvciB7QGxpbmsgQ2xpZW50I3NlbmR9LlxuICogQG1ldGhvZFxuICogQG5hbWUgQ2xpZW50I2VtaXRcbiAqL1xuQ2xpZW50LnByb3RvdHlwZS5lbWl0ID0gQ2xpZW50LnByb3RvdHlwZS5zZW5kXG5cbi8qKlxuICogQWxpYXMgZm9yIHtAbGluayBDbGllbnQjc2VuZEVuY29kZWR9LlxuICogQG1ldGhvZFxuICogQG5hbWUgQ2xpZW50I2VtaXRFbmNvZGVkXG4gKi9cbkNsaWVudC5wcm90b3R5cGUuZW1pdEVuY29kZWQgPSBDbGllbnQucHJvdG90eXBlLnNlbmRFbmNvZGVkXG5cbkNsaWVudC5Db25uZWN0aW9uRXJyb3IgPSBDb25uZWN0aW9uRXJyb3JcbkNsaWVudC5Ob1Byb2NlZHVyZUVycm9yID0gTm9Qcm9jZWR1cmVFcnJvclxuQ2xpZW50LlRpbWVvdXRFcnJvciA9IFRpbWVvdXRFcnJvclxuXG5tb2R1bGUuZXhwb3J0cyA9IENsaWVudFxuIl19
{
"name": "ws-messaging",
"version": "0.7.1",
"version": "0.7.2",
"description": "A minimalistic abstraction layer for websockets.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -323,3 +323,3 @@ 'use strict'

.then(() => { if (!this.skipValidation) { validate(message) } })
.then(() => { if (this.receiveHook) this.receiveHook(message) })
.then(() => { if (this.receiveHook) { return this.receiveHook(message) } })
.then(() => this._dispatch(message))

@@ -326,0 +326,0 @@ /**

@@ -120,3 +120,3 @@ 'use strict'

client.send('someEvent', data)
return eventToPromise(c, ('someEvent'))
return eventToPromise(c, 'someEvent')
}).then(d => {

@@ -138,3 +138,3 @@ expect(d).eql(data)

client.sendEncoded(m)
return eventToPromise(c, ('someEvent'))
return eventToPromise(c, 'someEvent')
}).then(d => {

@@ -156,3 +156,3 @@ expect(d).eql(data)

client.sendEncoded(m)
return eventToPromise(c, ('someEvent'))
return eventToPromise(c, 'someEvent')
}).then(d => {

@@ -172,3 +172,3 @@ expect(d).eql(data)

c.send('someEvent', data)
return eventToPromise(client, ('someEvent'))
return eventToPromise(client, 'someEvent')
}).then(d => {

@@ -180,7 +180,8 @@ expect(d).eql(data)

it('should run a receive hook', function () {
let id, run
let id
let run = 0
function connectionHook (client) { id = client.id }
function receiveHook (msg) {
expect(msg).an('object')
run = true
run++
}

@@ -192,8 +193,30 @@ server = new Server({port}, {connectionHook})

c.send('someEvent')
return eventToPromise(client, ('someEvent'))
return eventToPromise(client, 'someEvent')
}).then(d => {
expect(run).true
expect(run).equal(2)
})
})
it('should emit errors from receive hook', function () {
let id, run, error
function connectionHook (client) { id = client.id }
function receiveHook (msg) {
if (run) {
error = new Error('error')
return Promise.reject(error)
} else {
run = true
}
}
server = new Server({port}, {connectionHook})
client = new Client(url, {WebSocket, receiveHook})
return eventToPromise(client, 'connect').then(() => {
let c = server.getClient(id)
c.send('someEvent')
return eventToPromise(c, 'preprocessingError')
}).then(err => {
expect(err).equal(error.toString())
})
})
it('should run a send hook', function () {

@@ -212,3 +235,3 @@ let id, run

c.send('someEvent')
return eventToPromise(client, ('someEvent'))
return eventToPromise(client, 'someEvent')
}).then(d => {

@@ -275,3 +298,3 @@ expect(run).true

client.send('someEvent', data)
return eventToPromise(c, ('someEvent'))
return eventToPromise(c, 'someEvent')
}).then(d => {

@@ -490,3 +513,3 @@ expect(d).eql(data)

c.socket.send(JSON.stringify(msg))
return eventToPromise(client, ('someEvent'))
return eventToPromise(client, 'someEvent')
})

@@ -493,0 +516,0 @@ })

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.wsMessaging = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function isBlacklistedEvent(e){return blacklist.indexOf(e)>=0}function getOwnProp(e,t){return e.hasOwnProperty(t)?e[t]:void 0}function ConnectionError(e){this.name="ConnectionError",this.id=e}function TimeoutError(e){this.name="TimeoutError",this.id=e}function NoProcedureError(e){this.name="NoProcedureError",this.procedure=e}function validateId(e){return"number"==typeof e&&e%1===0&&e>0}function validate(e){var t=!1;if(e instanceof Object)if(e.name){if("string"==typeof e.name&&e.args instanceof Array){var n=Object.keys(e).length;(2===n||3===n&&validateId(e.id))&&(t=!0)}}else{var r=Object.keys(e).length;2===r&&validateId(e.id)&&(e.hasOwnProperty("error")||e.hasOwnProperty("result"))&&(t=!0)}if(!t)throw new Error("Validation error")}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),EventEmitter=require("eventemitter3"),_require=require("./utils"),assign=_require.assign,attempt=_require.attempt,fromCallback=_require.fromCallback,Promise=_require.Promise,blacklist=["close","open","error","pong","retry"],concat=[].concat.bind([]),emit=EventEmitter.prototype.emit;ConnectionError.prototype=Object.create(Error.prototype),TimeoutError.prototype=Object.create(Error.prototype),NoProcedureError.prototype=Object.create(Error.prototype);var Ack=function(){function e(t,n,r){var o=this;_classCallCheck(this,e),this.id=t,this.promise=new Promise(function(e,t){o.resolve=e,o.reject=t}),this.cb=r,this.timeout=setTimeout(function(){return o.forceNack(new TimeoutError(t))},n)}return _createClass(e,[{key:"forceNack",value:function(e){clearTimeout(this.timeout),this.cb(),this.reject(e)}},{key:"settle",value:function(e){clearTimeout(this.timeout),this.cb(),e.hasOwnProperty("error")?this.reject(e.error):this.resolve(e.result)}}]),e}(),retryConfig={factor:2,maxTimeout:1/0,minTimeout:1e3,randomize:!0,retries:10},defaults={ackTimeout:2e4,auth:{},autoReconnect:!0,autoReconnectOptions:retryConfig,binaryType:"arraybuffer",decoder:JSON.parse,encoder:JSON.stringify,errorFormatter:String,pingInterval:2e4,pingTimeout:2e4,protocols:"ws-messaging",receiveHook:null,sendHook:null,skipValidation:!1,WebSocket:void 0,w3c:void 0,wsOptions:void 0},Client=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.url=e,assign(r,defaults,n),r.retryConfig={},assign(r.retryConfig,retryConfig,n.autoReconnectOptions),r.WebSocket||(r.WebSocket=WebSocket,r.w3c=void 0===r.w3c||r.w3c),r.connected=!1,r.counter=1,r.data={},r.handlers={},r.pendingAcks={},r.attempt=0,r.terminated=!1,r.register("ping",function(){return Promise.resolve()}),r.reconnect(),r}return _inherits(t,e),_createClass(t,[{key:"_onMessage",value:function(e){var t=this,n=void 0;attempt(function(){return t.decoder(e.data)}).then(function(e){n=e}).then(function(){t.skipValidation||validate(n)}).then(function(){t.receiveHook&&t.receiveHook(n)}).then(function(){return t._dispatch(n)}).catch(function(e){return t.send("preprocessingError",t.errorFormatter(e))})}},{key:"_setEvents",value:function(){this.socket.onopen=emit.bind(this,"open"),this.socket.onerror=emit.bind(this,"error"),this.socket.onclose=this._onClose.bind(this),this.socket.onmessage=this._onMessage.bind(this)}},{key:"_ping",value:function(){var e=this;this.pingTimeoutId=setTimeout(function(){emit.call(e,"ping");var t=e.pingTimeout,n=e._makeMessage("ping",[],!0,t),r=n.message,o=n.promise;e._send(r).then(function(){return o}).then(function(){return emit.call(e,"pong")}).then(function(){return e._ping()}).catch(function(){return e.close(4008,"Ping timeout",!1)})},this.pingInterval)}},{key:"_isOpen",value:function(){return this.socket&&(0===this.socket.readyState||1===this.socket.readyState)}},{key:"_reconnect",value:function(){var e=this.retryConfig,t=e.factor,n=e.maxTimeout,r=e.minTimeout,o=e.randomize,i=e.retries;if(!(this.attempt>=i||this.terminated)){var s=1+(o?Math.random():0),c=Math.min(s*r*Math.pow(t,this.attempt),n);this.reconnectTimeoutId=setTimeout(this.reconnect.bind(this),c),this.attempt++}}},{key:"_open",value:function(){var e=this;clearTimeout(this.reconnectTimeoutId),this.socket=new this.WebSocket(this.url,this.protocols,this.wsOptions),this.w3c&&(this.socket.binaryType=this.binaryType),this.connectHandler=function(){e.connected=!0,e.attempt=0,clearTimeout(e.authTimeoutId),e._ping()},this.openHandler=function(){e._send(e.auth,{isAuth:!0}),e.authTimeoutId=setTimeout(e.close.bind(e,4008,"Auth timeout",!1),e.ackTimeout),e.once("connect",e.connectHandler)},this.once("open",this.openHandler),this._setEvents(),this.attempt>0&&emit.call(this,"retry",this.attempt)}},{key:"_onClose",value:function(e){this.connected=!1,clearTimeout(this.pingTimeoutId),clearTimeout(this.authTimeoutId),clearTimeout(this.reconnectTimeoutId),this.off("connect",this.connectHandler),this.off("open",this.openHandler),4003!==e.code&&this.url||(this.terminated=!0);for(var t in this.pendingAcks)if(this.pendingAcks.hasOwnProperty(t)){var n=this.pendingAcks[t];n.forceNack(new ConnectionError(t))}this.pendingAcks={},!this.terminated&&this.autoReconnect&&this._reconnect(),emit.call(this,"close",e)}},{key:"_makeMessage",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.ackTimeout,i=void 0,s=void 0;return s={name:e,args:t},n&&!function(){var e=r.counter++,t=new Ack(e,o,function(){return delete r.pendingAcks[e]});r.pendingAcks[e]=t,i=t.promise,s.id=e}(),{message:s,promise:i}}},{key:"_dispatch",value:function(e){var t=this;if(e.name){if(isBlacklistedEvent(e.name))return;if("connect"===e.name&&this.connected)return;e.id?!function(){var n=e.id,r=getOwnProp(t.handlers,e.name);if(r)attempt(function(){return r.apply(null,e.args)}).then(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t._send({id:n,result:e})}).catch(function(e){return t._send({id:n,error:t.errorFormatter(e)})});else{var o=t.errorFormatter(new NoProcedureError(e.name));t._send({id:n,error:o})}}():emit.apply(this,concat(e.name,e.args))}else{var n=this.pendingAcks[e.id];n&&n.settle(e)}}},{key:"_send",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.skipEncoder,o=void 0!==r&&r,i=n.isAuth,s=void 0!==i&&i;return attempt(function(){return t.sendHook?t.sendHook(e,o):null}).then(function(){return o?e:t.encoder(e)}).then(function(n){if(!t.connected&&!s){var r=o?void 0:e.id;throw new ConnectionError(r)}if(t.w3c)return t.socket.send(n);var i=function(){var e="string"!=typeof n;return{v:fromCallback(function(r){return t.socket.send(n,{binary:e},r)})}}();return"object"===("undefined"==typeof i?"undefined":_typeof(i))?i.v:void 0})}},{key:"send",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this._makeMessage(e,n,!1),i=o.message;return this._send(i)}},{key:"sendEncoded",value:function(e){return this._send(e,{skipEncoder:!0})}},{key:"encodeMessage",value:function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=this._makeMessage(e,r,!1),s=i.message;return attempt(function(){return t.encoder(s)})}},{key:"invoke",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this._makeMessage(e,n,!0),i=o.message,s=o.promise;return this._send(i).then(function(){return s})}},{key:"register",value:function(e,t){if(getOwnProp(this.handlers,e))throw new Error("Can't register a duplicate RPC handler for "+e);this.handlers[e]=t}},{key:"reconnect",value:function(){if(this.terminated=!1,!this._isOpen()){if(!this.WebSocket||!this.url)throw new Error("Malformed configuration options");this._open()}}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.terminated||(this.terminated=n,this._isOpen()&&this.socket.close(e,t))}}]),t}(EventEmitter);Client.prototype.emit=Client.prototype.send,Client.prototype.emitEncoded=Client.prototype.sendEncoded,Client.ConnectionError=ConnectionError,Client.NoProcedureError=NoProcedureError,Client.TimeoutError=TimeoutError,module.exports=Client;
"use strict";function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function isBlacklistedEvent(e){return blacklist.indexOf(e)>=0}function getOwnProp(e,t){return e.hasOwnProperty(t)?e[t]:void 0}function ConnectionError(e){this.name="ConnectionError",this.id=e}function TimeoutError(e){this.name="TimeoutError",this.id=e}function NoProcedureError(e){this.name="NoProcedureError",this.procedure=e}function validateId(e){return"number"==typeof e&&e%1===0&&e>0}function validate(e){var t=!1;if(e instanceof Object)if(e.name){if("string"==typeof e.name&&e.args instanceof Array){var n=Object.keys(e).length;(2===n||3===n&&validateId(e.id))&&(t=!0)}}else{var r=Object.keys(e).length;2===r&&validateId(e.id)&&(e.hasOwnProperty("error")||e.hasOwnProperty("result"))&&(t=!0)}if(!t)throw new Error("Validation error")}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),EventEmitter=require("eventemitter3"),_require=require("./utils"),assign=_require.assign,attempt=_require.attempt,fromCallback=_require.fromCallback,Promise=_require.Promise,blacklist=["close","open","error","pong","retry"],concat=[].concat.bind([]),emit=EventEmitter.prototype.emit;ConnectionError.prototype=Object.create(Error.prototype),TimeoutError.prototype=Object.create(Error.prototype),NoProcedureError.prototype=Object.create(Error.prototype);var Ack=function(){function e(t,n,r){var o=this;_classCallCheck(this,e),this.id=t,this.promise=new Promise(function(e,t){o.resolve=e,o.reject=t}),this.cb=r,this.timeout=setTimeout(function(){return o.forceNack(new TimeoutError(t))},n)}return _createClass(e,[{key:"forceNack",value:function(e){clearTimeout(this.timeout),this.cb(),this.reject(e)}},{key:"settle",value:function(e){clearTimeout(this.timeout),this.cb(),e.hasOwnProperty("error")?this.reject(e.error):this.resolve(e.result)}}]),e}(),retryConfig={factor:2,maxTimeout:1/0,minTimeout:1e3,randomize:!0,retries:10},defaults={ackTimeout:2e4,auth:{},autoReconnect:!0,autoReconnectOptions:retryConfig,binaryType:"arraybuffer",decoder:JSON.parse,encoder:JSON.stringify,errorFormatter:String,pingInterval:2e4,pingTimeout:2e4,protocols:"ws-messaging",receiveHook:null,sendHook:null,skipValidation:!1,WebSocket:void 0,w3c:void 0,wsOptions:void 0},Client=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.url=e,assign(r,defaults,n),r.retryConfig={},assign(r.retryConfig,retryConfig,n.autoReconnectOptions),r.WebSocket||(r.WebSocket=WebSocket,r.w3c=void 0===r.w3c||r.w3c),r.connected=!1,r.counter=1,r.data={},r.handlers={},r.pendingAcks={},r.attempt=0,r.terminated=!1,r.register("ping",function(){return Promise.resolve()}),r.reconnect(),r}return _inherits(t,e),_createClass(t,[{key:"_onMessage",value:function(e){var t=this,n=void 0;attempt(function(){return t.decoder(e.data)}).then(function(e){n=e}).then(function(){t.skipValidation||validate(n)}).then(function(){if(t.receiveHook)return t.receiveHook(n)}).then(function(){return t._dispatch(n)}).catch(function(e){return t.send("preprocessingError",t.errorFormatter(e))})}},{key:"_setEvents",value:function(){this.socket.onopen=emit.bind(this,"open"),this.socket.onerror=emit.bind(this,"error"),this.socket.onclose=this._onClose.bind(this),this.socket.onmessage=this._onMessage.bind(this)}},{key:"_ping",value:function(){var e=this;this.pingTimeoutId=setTimeout(function(){emit.call(e,"ping");var t=e.pingTimeout,n=e._makeMessage("ping",[],!0,t),r=n.message,o=n.promise;e._send(r).then(function(){return o}).then(function(){return emit.call(e,"pong")}).then(function(){return e._ping()}).catch(function(){return e.close(4008,"Ping timeout",!1)})},this.pingInterval)}},{key:"_isOpen",value:function(){return this.socket&&(0===this.socket.readyState||1===this.socket.readyState)}},{key:"_reconnect",value:function(){var e=this.retryConfig,t=e.factor,n=e.maxTimeout,r=e.minTimeout,o=e.randomize,i=e.retries;if(!(this.attempt>=i||this.terminated)){var s=1+(o?Math.random():0),c=Math.min(s*r*Math.pow(t,this.attempt),n);this.reconnectTimeoutId=setTimeout(this.reconnect.bind(this),c),this.attempt++}}},{key:"_open",value:function(){var e=this;clearTimeout(this.reconnectTimeoutId),this.socket=new this.WebSocket(this.url,this.protocols,this.wsOptions),this.w3c&&(this.socket.binaryType=this.binaryType),this.connectHandler=function(){e.connected=!0,e.attempt=0,clearTimeout(e.authTimeoutId),e._ping()},this.openHandler=function(){e._send(e.auth,{isAuth:!0}),e.authTimeoutId=setTimeout(e.close.bind(e,4008,"Auth timeout",!1),e.ackTimeout),e.once("connect",e.connectHandler)},this.once("open",this.openHandler),this._setEvents(),this.attempt>0&&emit.call(this,"retry",this.attempt)}},{key:"_onClose",value:function(e){this.connected=!1,clearTimeout(this.pingTimeoutId),clearTimeout(this.authTimeoutId),clearTimeout(this.reconnectTimeoutId),this.off("connect",this.connectHandler),this.off("open",this.openHandler),4003!==e.code&&this.url||(this.terminated=!0);for(var t in this.pendingAcks)if(this.pendingAcks.hasOwnProperty(t)){var n=this.pendingAcks[t];n.forceNack(new ConnectionError(t))}this.pendingAcks={},!this.terminated&&this.autoReconnect&&this._reconnect(),emit.call(this,"close",e)}},{key:"_makeMessage",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.ackTimeout,i=void 0,s=void 0;return s={name:e,args:t},n&&!function(){var e=r.counter++,t=new Ack(e,o,function(){return delete r.pendingAcks[e]});r.pendingAcks[e]=t,i=t.promise,s.id=e}(),{message:s,promise:i}}},{key:"_dispatch",value:function(e){var t=this;if(e.name){if(isBlacklistedEvent(e.name))return;if("connect"===e.name&&this.connected)return;e.id?!function(){var n=e.id,r=getOwnProp(t.handlers,e.name);if(r)attempt(function(){return r.apply(null,e.args)}).then(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t._send({id:n,result:e})}).catch(function(e){return t._send({id:n,error:t.errorFormatter(e)})});else{var o=t.errorFormatter(new NoProcedureError(e.name));t._send({id:n,error:o})}}():emit.apply(this,concat(e.name,e.args))}else{var n=this.pendingAcks[e.id];n&&n.settle(e)}}},{key:"_send",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.skipEncoder,o=void 0!==r&&r,i=n.isAuth,s=void 0!==i&&i;return attempt(function(){return t.sendHook?t.sendHook(e,o):null}).then(function(){return o?e:t.encoder(e)}).then(function(n){if(!t.connected&&!s){var r=o?void 0:e.id;throw new ConnectionError(r)}if(t.w3c)return t.socket.send(n);var i=function(){var e="string"!=typeof n;return{v:fromCallback(function(r){return t.socket.send(n,{binary:e},r)})}}();return"object"===("undefined"==typeof i?"undefined":_typeof(i))?i.v:void 0})}},{key:"send",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this._makeMessage(e,n,!1),i=o.message;return this._send(i)}},{key:"sendEncoded",value:function(e){return this._send(e,{skipEncoder:!0})}},{key:"encodeMessage",value:function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=this._makeMessage(e,r,!1),s=i.message;return attempt(function(){return t.encoder(s)})}},{key:"invoke",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this._makeMessage(e,n,!0),i=o.message,s=o.promise;return this._send(i).then(function(){return s})}},{key:"register",value:function(e,t){if(getOwnProp(this.handlers,e))throw new Error("Can't register a duplicate RPC handler for "+e);this.handlers[e]=t}},{key:"reconnect",value:function(){if(this.terminated=!1,!this._isOpen()){if(!this.WebSocket||!this.url)throw new Error("Malformed configuration options");this._open()}}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.terminated||(this.terminated=n,this._isOpen()&&this.socket.close(e,t))}}]),t}(EventEmitter);Client.prototype.emit=Client.prototype.send,Client.prototype.emitEncoded=Client.prototype.sendEncoded,Client.ConnectionError=ConnectionError,Client.NoProcedureError=NoProcedureError,Client.TimeoutError=TimeoutError,module.exports=Client;

@@ -4,0 +4,0 @@ },{"./utils":2,"eventemitter3":3}],2:[function(require,module,exports){

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