sockstream
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -47,3 +47,3 @@ 'use strict'; | ||
name: 'sockstream.js', | ||
version: 1.3, | ||
version: 1.2, | ||
debugLevel: 0, | ||
@@ -169,3 +169,3 @@ keepAlive: 800 | ||
if (this.connections[connectionId].readyState === this.connections[connectionId].OPEN) { | ||
var _id = StreamSocketClient.generateUUID(); | ||
var _id = StreamSock.generateUUID(); | ||
if (typeof cb === 'function') { | ||
@@ -199,3 +199,3 @@ this.callbackRegister[_id] = cb; | ||
this.console(['[CONNECTING]', '' + this._config.server.proto + this._config.server.hostname + ':' + this._config.server.port], 'info'); | ||
var connectionId = StreamSocketClient.generateUUID(); | ||
var connectionId = StreamSock.generateUUID(); | ||
this.lastConnectionId = connectionId; | ||
@@ -214,3 +214,3 @@ this.connections[connectionId] = new WebSocket('' + this._config.server.proto + this._config.server.hostname + ':' + this._config.server.port); | ||
this.connections[connectionId].onmessage = function (e) { | ||
var parsed = StreamSocketClient.parseMessage(e.data); | ||
var parsed = StreamSock.parseMessage(e.data); | ||
if (parsed && typeof parsed['@meta'] !== 'undefined') { | ||
@@ -270,2 +270,2 @@ if (typeof _this2.callbackRegister[parsed['@meta']._type] === 'function') { | ||
exports.default = StreamSock; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvY2tzdHJlYW0uanMiXSwibmFtZXMiOlsiU3RyZWFtU29jayIsImhvc3QiLCJwb3J0Iiwic2VjdXJlIiwia2VlcEFsaXZlIiwiZGVidWdMZXZlbCIsImNhbGxiYWNrUmVnaXN0ZXIiLCJwaW5nIiwic2VuZCIsImNvbnNvbGUiLCJtZXNzYWdlIiwic3lzdGVtIiwiZGlzY29ubmVjdCIsImNvbm5lY3Rpb25zIiwiX2NvbmZpZyIsImNsaWVudCIsIm5hbWUiLCJ2ZXJzaW9uIiwic2VydmVyIiwiaG9zdG5hbWUiLCJwcm90byIsIk9iamVjdCIsImFzc2lnbiIsInR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MyxcbiAgICAgICAgaG9zdG5hbWU6ICdsb2NhbGhvc3QnLFxuICAgICAgICBwb3J0OiA4MDgyLFxuICAgICAgICBwcm90bzogJ3dzczovLydcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKHR5cGVvZiBob3N0ID09PSAnb2JqZWN0Jykge1xuICAgICAgaWYgKHR5cGVvZiBob3N0LmNsaWVudCA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgdGhpcy5fY29uZmlnLmNsaWVudCA9IE9iamVjdC5hc3NpZ24oe1xuICAgICAgICAgIGRlYnVnTGV2ZWw6IDAsXG4gICAgICAgICAga2VlcEFsaXZlOiA4MDBcbiAgICAgICAgfSwgaG9zdC5jbGllbnQsIHtcbiAgICAgICAgICBuYW1lOiAnc29ja3N0cmVhbS5qcycsXG4gICAgICAgICAgdmVyc2lvbjogMC4xXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgICBpZiAodHlwZW9mIGhvc3Quc2VydmVyID09PSAnb2JqZWN0Jykge1xuICAgICAgICB0aGlzLl9jb25maWcuc2VydmVyID0gT2JqZWN0LmFzc2lnbih7XG4gICAgICAgICAgaG9zdG5hbWU6ICdsb2NhbGhvc3QnLFxuICAgICAgICAgIHBvcnQ6IDgwODIsXG4gICAgICAgICAgcHJvdG86ICd3c3M6Ly8nXG4gICAgICAgIH0sIGhvc3Quc2VydmVyLCB7XG4gICAgICAgICAgbmFtZTogJ3NvY2tldHMvcGhwLXN0cmVhbS1zb2NrZXQtc2VydmVyJyxcbiAgICAgICAgICB2ZXJzaW9uOiAxLjNcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgdGhpcy5fY29uZmlnID0ge1xuICAgICAgICBjbGllbnQ6IHtcbiAgICAgICAgICBuYW1lOiAnc29ja3N0cmVhbS5qcycsXG4gICAgICAgICAgdmVyc2lvbjogMC4xLFxuICAgICAgICAgIGRlYnVnTGV2ZWw6IGRlYnVnTGV2ZWwsXG4gICAgICAgICAga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YWxsYmFja1JlZ2lzdGVyW3BhcnNlZFsnQG1ldGEnXS5faWRdLmNhbGwodGhpcy5fY29uZmlnLCBwYXJzZWQubWVzc2FnZSB8fCBudWxsKVxuICAgICAgICAgICAgZGVsZXRlIHRoaXMuY2FsbGJhY2tSZWdpc3RlcltwYXJzZWRbJ0BtZXRhJ10uX2lkXVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLmNvbnNvbGUoWydbUkNWRF0nLCBwYXJzZWRdLCAnZGVidWcnKVxuICAgICAgfVxuICAgICAgdGhpcy5jb25uZWN0aW9uc1tjb25uZWN0aW9uSWRdLm9uY2xvc2UgPSBlID0+IHtcbiAgICAgICAgdGhpcy5jb25zb2xlKFsnV2ViU29ja2V0IGNsb3NlZCcsIGVdLCAnd2FybicpXG4gICAgICAgIGlmICh0aGlzLmRpc2Nvbm5lY3QuaW5kZXhPZihjb25uZWN0aW9uSWQpID09PSAtMSAmJiB0eXBlb2YgdGhpcy5fY29uZmlnLmNsaWVudC5rZWVwQWxpdmUgPT09ICdudW1iZXInICYmIHRoaXMuX2NvbmZpZy5jbGllbnQua2VlcEFsaXZlID4gMCkge1xuICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgICAgdGhpcy5jb25zb2xlKCdBdHRlbXB0aW5nIHRvIHJlZXN0YWJsaXNoIFdlYlNvY2tldCcsICdpbmZvJylcbiAgICAgICAgICAgIHRoaXMub3BlbigpXG4gICAgICAgICAgfSwgdGhpcy5fY29uZmlnLmNsaWVudC5rZWVwQWxpdmUpXG4gICAgICAgIH1cbiAgICAgICAgZGVsZXRlIHRoaXMuY29ubmVjdGlvbnNbY29ubmVjdGlvbklkXVxuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBjb25uZWN0aW9uSWQ7XG4gIH1cbn0iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvY2tzdHJlYW0uanMiX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yA9IHtcbiAgICAgIGNsaWVudDoge1xuICAgICAgICBuYW1lOiAnc29ja3N0cmVhbS5qcycsXG4gICAgICAgIHZlcnNpb246IDEuMixcbiAgICAgICAgZGVidWdMZXZlbDogMCxcbiAgICAgICAga2VlcEFsaXZlOiA4MDBcbiAgICAgIH0sXG4gICAgICBzZXJ2ZXI6IHtcbiAgICAgICAgbmFtZTogJ3NvY2tldHMvcGhwLXN0cmVhbS1zb2NrZXQtc2VydmVyJyxcbiAgICAgICAgdmVyc2lvbjogMS4zLFxuICAgICAgICBob3N0bmFtZTogJ2xvY2FsaG9zdCcsXG4gICAgICAgIHBvcnQ6IDgwODIsXG4gICAgICAgIHByb3RvOiAnd3NzOi8vJ1xuICAgICAgfVxuICAgIH1cbiAgICBpZiAodHlwZW9mIGhvc3QgPT09ICdvYmplY3QnKSB7XG4gICAgICBpZiAodHlwZW9mIGhvc3QuY2xpZW50ID09PSAnb2JqZWN0Jykge1xuICAgICAgICB0aGlzLl9jb25maWcuY2xpZW50ID0gT2JqZWN0LmFzc2lnbih7XG4gICAgICAgICAgZGVidWdMZXZlbDogMCxcbiAgICAgICAgICBrZWVwQWxpdmU6IDgwMFxuICAgICAgICB9LCBob3N0LmNsaWVudCwge1xuICAgICAgICAgIG5hbWU6ICdzb2Nrc3RyZWFtLmpzJyxcbiAgICAgICAgICB2ZXJzaW9uOiAwLjFcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICAgIGlmICh0eXBlb2YgaG9zdC5zZXJ2ZXIgPT09ICdvYmplY3QnKSB7XG4gICAgICAgIHRoaXMuX2NvbmZpZy5zZXJ2ZXIgPSBPYmplY3QuYXNzaWduKHtcbiAgICAgICAgICBob3N0bmFtZTogJ2xvY2FsaG9zdCcsXG4gICAgICAgICAgcG9ydDogODA4MixcbiAgICAgICAgICBwcm90bzogJ3dzczovLydcbiAgICAgICAgfSwgaG9zdC5zZXJ2ZXIsIHtcbiAgICAgICAgICBuYW1lOiAnc29ja2V0cy9waHAtc3Ry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ICAgICAgICB9LCB0aGlzLl9jb25maWcuY2xpZW50LmtlZXBBbGl2ZSlcbiAgICAgICAgfVxuICAgICAgICBkZWxldGUgdGhpcy5jb25uZWN0aW9uc1tjb25uZWN0aW9uSWRdXG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbm5lY3Rpb25JZDtcbiAgfVxufVxuIl19 |
@@ -1,1 +0,1 @@ | ||
"use strict";function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});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,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),StreamSock=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"localhost",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8082,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:800,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;_classCallCheck(this,e),this.callbackRegister={ping:function(e){i.send("pong"),i.console(["[PING]",e])},system:function(e){i.console(["[SYSTEM]",e])}},this.disconnect=[],this.connections={},this._config={client:{name:"sockstream.js",version:1.3,debugLevel:0,keepAlive:800},server:{name:"sockets/php-stream-socket-server",version:1.3,hostname:"localhost",port:8082,proto:"wss://"}},"object"===("undefined"==typeof n?"undefined":_typeof(n))?("object"===_typeof(n.client)&&(this._config.client=Object.assign({debugLevel:0,keepAlive:800},n.client,{name:"sockstream.js",version:.1})),"object"===_typeof(n.server)&&(this._config.server=Object.assign({hostname:"localhost",port:8082,proto:"wss://"},n.server,{name:"sockets/php-stream-socket-server",version:1.3}))):this._config={client:{name:"sockstream.js",version:.1,debugLevel:c,keepAlive:s},server:{name:"sockets/php-stream-socket-server",version:1.3,hostname:n,port:t,proto:o?"wss://":"ws://"}}}return _createClass(e,[{key:"console",value:function(e){function n(n){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log",t={log:4,debug:3,info:2,warn:1,error:0};this._config.client.debugLevel>=(t[n]||0)&&console[n](e)})},{key:"debug",value:function(e){return"undefined"!=typeof e&&(this._config.client.debug=!!e),this._config.client.debug}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=e||this.lastConnectionId;return"undefined"!=typeof this.connections[n]&&(this.disconnect.push(n),this.connections[n].close()),!0}},{key:"send",value:function(e,n){var t=this.lastConnectionId;if("function"!=typeof n&&"undefined"!=typeof this.connections[n]&&(this.lastConnectionId=t=n),"undefined"==typeof this.connections[t])return!1;if(this.connections[t].readyState===this.connections[t].OPEN){var o=StreamSocketClient.generateUUID();return"function"==typeof n&&(this.callbackRegister[o]=n),this.connections[t].send(JSON.stringify({"@meta":Object.assign({_id:o},this._config),message:e})),!0}return this.console("WebSocket not open","warn"),!1}},{key:"open",value:function(e){var n=this;this.console(["[CONNECTING]",""+this._config.server.proto+this._config.server.hostname+":"+this._config.server.port],"info");var t=StreamSocketClient.generateUUID();return this.lastConnectionId=t,this.connections[t]=new WebSocket(""+this._config.server.proto+this._config.server.hostname+":"+this._config.server.port),this.connections[t].readyState===this.connections[t].CONNECTING&&(this.connections[t].onopen=function(){n.console("connected","info"),setTimeout(function(){n.send("connecting",e)},20)},this.connections[t].onerror=function(e){n.console(["WebSocket error",e],"error")},this.connections[t].onmessage=function(e){var t=StreamSocketClient.parseMessage(e.data);t&&"undefined"!=typeof t["@meta"]&&("function"==typeof n.callbackRegister[t["@meta"]._type]?n.callbackRegister[t["@meta"]._type].call(n._config,t["@meta"]._system):"function"==typeof n.callbackRegister[t["@meta"]._id]&&(n.callbackRegister[t["@meta"]._id].call(n._config,t.message||null),delete n.callbackRegister[t["@meta"]._id])),n.console(["[RCVD]",t],"debug")},this.connections[t].onclose=function(e){n.console(["WebSocket closed",e],"warn"),n.disconnect.indexOf(t)===-1&&"number"==typeof n._config.client.keepAlive&&n._config.client.keepAlive>0&&setTimeout(function(){n.console("Attempting to reestablish WebSocket","info"),n.open()},n._config.client.keepAlive),delete n.connections[t]}),t}}],[{key:"generateUUID",value:function(){var e=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==n?t:3&t|8).toString(16)})}},{key:"parseMessage",value:function(e){return"undefined"==typeof e?null:"string"==typeof e?JSON.parse(e):e}}]),e}();exports.default=StreamSock; | ||
"use strict";function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});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,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),StreamSock=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"localhost",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8082,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:800,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;_classCallCheck(this,e),this.callbackRegister={ping:function(e){i.send("pong"),i.console(["[PING]",e])},system:function(e){i.console(["[SYSTEM]",e])}},this.disconnect=[],this.connections={},this._config={client:{name:"sockstream.js",version:1.2,debugLevel:0,keepAlive:800},server:{name:"sockets/php-stream-socket-server",version:1.3,hostname:"localhost",port:8082,proto:"wss://"}},"object"===("undefined"==typeof n?"undefined":_typeof(n))?("object"===_typeof(n.client)&&(this._config.client=Object.assign({debugLevel:0,keepAlive:800},n.client,{name:"sockstream.js",version:.1})),"object"===_typeof(n.server)&&(this._config.server=Object.assign({hostname:"localhost",port:8082,proto:"wss://"},n.server,{name:"sockets/php-stream-socket-server",version:1.3}))):this._config={client:{name:"sockstream.js",version:.1,debugLevel:c,keepAlive:s},server:{name:"sockets/php-stream-socket-server",version:1.3,hostname:n,port:t,proto:o?"wss://":"ws://"}}}return _createClass(e,[{key:"console",value:function(e){function n(n){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log",t={log:4,debug:3,info:2,warn:1,error:0};this._config.client.debugLevel>=(t[n]||0)&&console[n](e)})},{key:"debug",value:function(e){return"undefined"!=typeof e&&(this._config.client.debug=!!e),this._config.client.debug}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=e||this.lastConnectionId;return"undefined"!=typeof this.connections[n]&&(this.disconnect.push(n),this.connections[n].close()),!0}},{key:"send",value:function(n,t){var o=this.lastConnectionId;if("function"!=typeof t&&"undefined"!=typeof this.connections[t]&&(this.lastConnectionId=o=t),"undefined"==typeof this.connections[o])return!1;if(this.connections[o].readyState===this.connections[o].OPEN){var i=e.generateUUID();return"function"==typeof t&&(this.callbackRegister[i]=t),this.connections[o].send(JSON.stringify({"@meta":Object.assign({_id:i},this._config),message:n})),!0}return this.console("WebSocket not open","warn"),!1}},{key:"open",value:function(n){var t=this;this.console(["[CONNECTING]",""+this._config.server.proto+this._config.server.hostname+":"+this._config.server.port],"info");var o=e.generateUUID();return this.lastConnectionId=o,this.connections[o]=new WebSocket(""+this._config.server.proto+this._config.server.hostname+":"+this._config.server.port),this.connections[o].readyState===this.connections[o].CONNECTING&&(this.connections[o].onopen=function(){t.console("connected","info"),setTimeout(function(){t.send("connecting",n)},20)},this.connections[o].onerror=function(e){t.console(["WebSocket error",e],"error")},this.connections[o].onmessage=function(n){var o=e.parseMessage(n.data);o&&"undefined"!=typeof o["@meta"]&&("function"==typeof t.callbackRegister[o["@meta"]._type]?t.callbackRegister[o["@meta"]._type].call(t._config,o["@meta"]._system):"function"==typeof t.callbackRegister[o["@meta"]._id]&&(t.callbackRegister[o["@meta"]._id].call(t._config,o.message||null),delete t.callbackRegister[o["@meta"]._id])),t.console(["[RCVD]",o],"debug")},this.connections[o].onclose=function(e){t.console(["WebSocket closed",e],"warn"),t.disconnect.indexOf(o)===-1&&"number"==typeof t._config.client.keepAlive&&t._config.client.keepAlive>0&&setTimeout(function(){t.console("Attempting to reestablish WebSocket","info"),t.open()},t._config.client.keepAlive),delete t.connections[o]}),o}}],[{key:"generateUUID",value:function(){var e=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==n?t:3&t|8).toString(16)})}},{key:"parseMessage",value:function(e){return"undefined"==typeof e?null:"string"==typeof e?JSON.parse(e):e}}]),e}();exports.default=StreamSock; |
{ | ||
"name": "sockstream", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Provides a standard WebSocket thin manager", | ||
"main": "src/sockstream.js", | ||
"main": "index.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "start": "node_modules/gulp/bin/gulp.js", |
@@ -24,3 +24,3 @@ export default class StreamSock { | ||
name: 'sockstream.js', | ||
version: 1.3, | ||
version: 1.2, | ||
debugLevel: 0, | ||
@@ -145,3 +145,3 @@ keepAlive: 800 | ||
if (this.connections[connectionId].readyState === this.connections[connectionId].OPEN) { | ||
let _id = StreamSocketClient.generateUUID() | ||
let _id = StreamSock.generateUUID() | ||
if (typeof cb === 'function') { | ||
@@ -170,3 +170,3 @@ this.callbackRegister[_id] = cb | ||
this.console(['[CONNECTING]',`${this._config.server.proto}${this._config.server.hostname}:${this._config.server.port}`], 'info') | ||
let connectionId = StreamSocketClient.generateUUID() | ||
let connectionId = StreamSock.generateUUID() | ||
this.lastConnectionId = connectionId | ||
@@ -185,3 +185,3 @@ this.connections[connectionId] = new WebSocket(`${this._config.server.proto}${this._config.server.hostname}:${this._config.server.port}`) | ||
this.connections[connectionId].onmessage = e => { | ||
let parsed = StreamSocketClient.parseMessage(e.data); | ||
let parsed = StreamSock.parseMessage(e.data); | ||
if (parsed && typeof parsed['@meta'] !== 'undefined') { | ||
@@ -211,2 +211,2 @@ if (typeof this.callbackRegister[parsed['@meta']._type] === 'function') { | ||
} | ||
} | ||
} |
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
500
52556