11/**
2- * SocketCluster JavaScript client v15.0.2
2+ * SocketCluster JavaScript client v15.1.0
33 */
44 ( 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 . socketClusterClient = f ( ) } } ) ( function ( ) { var define , module , exports ; return ( function ( ) { function r ( e , n , t ) { function o ( i , f ) { if ( ! n [ i ] ) { if ( ! e [ i ] ) { var c = "function" == typeof require && require ; if ( ! f && c ) return c ( i , ! 0 ) ; if ( u ) return u ( i , ! 0 ) ; var a = new Error ( "Cannot find module '" + i + "'" ) ; throw a . code = "MODULE_NOT_FOUND" , a } var p = n [ i ] = { exports :{ } } ; e [ i ] [ 0 ] . call ( p . exports , function ( r ) { var n = e [ i ] [ 1 ] [ r ] ; return o ( n || r ) } , p , p . exports , r , e , n , t ) } return n [ i ] . exports } for ( var u = "function" == typeof require && require , i = 0 ; i < t . length ; i ++ ) o ( t [ i ] ) ; return o } return r } ) ( ) ( { 1 :[ function ( require , module , exports ) {
55( function ( global ) {
@@ -90,6 +90,8 @@ function AGClientSocket(socketOptions) {
9090 let defaultOptions = {
9191 path : '/socketcluster/' ,
9292 secure : false ,
93+ protocolScheme : null ,
94+ socketPath : null ,
9395 autoConnect : true ,
9496 autoReconnect : true ,
9597 autoSubscribeOnConnect : true ,
@@ -1747,7 +1749,12 @@ AGTransport.CLOSED = AGTransport.prototype.CLOSED = 'closed';
17471749
17481750AGTransport . prototype . uri = function ( ) {
17491751 let query = this . options . query || { } ;
1750- let schema = this . options . secure ? 'wss' : 'ws' ;
1752+ let scheme ;
1753+ if ( this . options . protocolScheme == null ) {
1754+ scheme = this . options . secure ? 'wss' : 'ws' ;
1755+ } else {
1756+ scheme = this . options . protocolScheme ;
1757+ }
17511758
17521759 if ( this . options . timestampRequests ) {
17531760 query [ this . options . timestampParam ] = ( new Date ( ) ) . getTime ( ) ;
@@ -1760,19 +1767,25 @@ AGTransport.prototype.uri = function () {
17601767 }
17611768
17621769 let host ;
1763- if ( this . options . host ) {
1764- host = this . options . host ;
1765- } else {
1766- let port = '' ;
1770+ let path ;
1771+ if ( this . options . socketPath == null ) {
1772+ if ( this . options . host ) {
1773+ host = this . options . host ;
1774+ } else {
1775+ let port = '' ;
17671776
1768- if ( this . options . port && ( ( schema === 'wss' && this . options . port !== 443 )
1769- || ( schema === 'ws' && this . options . port !== 80 ) ) ) {
1770- port = ':' + this . options . port ;
1777+ if ( this . options . port && ( ( scheme === 'wss' && this . options . port !== 443 )
1778+ || ( scheme === 'ws' && this . options . port !== 80 ) ) ) {
1779+ port = ':' + this . options . port ;
1780+ }
1781+ host = this . options . hostname + port ;
17711782 }
1772- host = this . options . hostname + port ;
1783+ path = this . options . path ;
1784+ } else {
1785+ host = this . options . socketPath ;
1786+ path = `:${ this . options . path } ` ;
17731787 }
1774-
1775- return schema + '://' + host + this . options . path + query ;
1788+ return scheme + '://' + host + path + query ;
17761789} ;
17771790
17781791AGTransport . prototype . _onOpen = async function ( ) {
@@ -6629,7 +6642,7 @@ module.exports = WritableConsumableStream;
66296642} , { "./consumer" :34 , "consumable-stream" :13 } ] , "socketcluster-client" :[ function ( require , module , exports ) {
66306643const AGClientSocket = require ( './lib/clientsocket' ) ;
66316644const factory = require ( './lib/factory' ) ;
6632- const version = '15.0.2 ' ;
6645+ const version = '15.1.0 ' ;
66336646
66346647module . exports . factory = factory ;
66356648module . exports . AGClientSocket = AGClientSocket ;
0 commit comments