@@ -129,7 +129,12 @@ AGTransport.CLOSED = AGTransport.prototype.CLOSED = 'closed';
129129
130130AGTransport . prototype . uri = function ( ) {
131131 let query = this . options . query || { } ;
132- let schema = this . options . secure ? 'wss' : 'ws' ;
132+ let scheme ;
133+ if ( this . options . protocolScheme == null ) {
134+ scheme = this . options . secure ? 'wss' : 'ws' ;
135+ } else {
136+ scheme = this . options . protocolScheme ;
137+ }
133138
134139 if ( this . options . timestampRequests ) {
135140 query [ this . options . timestampParam ] = ( new Date ( ) ) . getTime ( ) ;
@@ -142,19 +147,25 @@ AGTransport.prototype.uri = function () {
142147 }
143148
144149 let host ;
145- if ( this . options . host ) {
146- host = this . options . host ;
147- } else {
148- let port = '' ;
150+ let path ;
151+ if ( this . options . socketPath == null ) {
152+ if ( this . options . host ) {
153+ host = this . options . host ;
154+ } else {
155+ let port = '' ;
149156
150- if ( this . options . port && ( ( schema === 'wss' && this . options . port !== 443 )
151- || ( schema === 'ws' && this . options . port !== 80 ) ) ) {
152- port = ':' + this . options . port ;
157+ if ( this . options . port && ( ( scheme === 'wss' && this . options . port !== 443 )
158+ || ( scheme === 'ws' && this . options . port !== 80 ) ) ) {
159+ port = ':' + this . options . port ;
160+ }
161+ host = this . options . hostname + port ;
153162 }
154- host = this . options . hostname + port ;
163+ path = this . options . path ;
164+ } else {
165+ host = this . options . socketPath ;
166+ path = `:${ this . options . path } ` ;
155167 }
156-
157- return schema + '://' + host + this . options . path + query ;
168+ return scheme + '://' + host + path + query ;
158169} ;
159170
160171AGTransport . prototype . _onOpen = async function ( ) {
0 commit comments