Skip to content

Commit

Permalink
honor optional 'protocols' parm on intercepted WebSocket constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
rentallect committed Sep 13, 2024
1 parent 137a421 commit 11f1b37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/http/ziti-dummy-websocket-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ZitiDummyWebSocketWrapper extends EventEmitter {
*
* @param {(String|url.URL)} address The URL to which to connect
*/
constructor(address) {
constructor(address, protocols) {

super();

Expand Down Expand Up @@ -71,7 +71,7 @@ class ZitiDummyWebSocketWrapper extends EventEmitter {

if (isUndefined(serviceName)) { // If we have no serviceConfig associated with the address, do not intercept

self.innerWebSocket = new window._ziti_realWebSocket(self.address);
self.innerWebSocket = new window._ziti_realWebSocket(self.address, protocols);

} else {

Expand All @@ -80,7 +80,7 @@ class ZitiDummyWebSocketWrapper extends EventEmitter {
opts.serviceName = serviceName;
opts.configHostAndPort = await zitiBrowzerRuntime.zitiContext.getConfigHostAndPortByServiceName (serviceName);

self.innerWebSocket = new zitiBrowzerRuntime.zitiContext.zitiWebSocketWrapper(self.address, undefined, opts);
self.innerWebSocket = new zitiBrowzerRuntime.zitiContext.zitiWebSocketWrapper(self.address, protocols, opts);

}

Expand Down

0 comments on commit 11f1b37

Please sign in to comment.