Skip to content

Commit

Permalink
feat: TLS handshake timeout event (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
rentallect authored Dec 3, 2023
1 parent f93f46e commit b5c9b3d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
]
},
"dependencies": {
"@openziti/ziti-browzer-core": "^0.32.1",
"@openziti/ziti-browzer-core": "^0.33.0",
"async-mutex": "^0.3.2",
"cheerio": "^1.0.0-rc.12",
"jwt-decode": "^3.1.2",
Expand Down
13 changes: 12 additions & 1 deletion src/ZitiFirstStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ class ZitiFirstStrategy extends CacheFirst /* NetworkFirst */ {
this._zitiBrowzerServiceWorkerGlobalScope._xgressEvent(xgressEvent);

}

async nestedTLSHandshakeTimeoutEventHandler(nestedTLSHandshakeTimeoutEvent: any) {

this._zitiBrowzerServiceWorkerGlobalScope._nestedTLSHandshakeTimeout(nestedTLSHandshakeTimeoutEvent);

}

/**
* Do all work necessary to initialize the ZitiFirstStrategy instance.
Expand Down Expand Up @@ -399,6 +405,8 @@ class ZitiFirstStrategy extends CacheFirst /* NetworkFirst */ {
this._zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_CHANNEL_CONNECT_FAIL, this.channelConnectFailEventHandler);
this._zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_NO_WSS_ROUTERS, this.noWSSRoutersEventHandler);
this._zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_XGRESS, this.xgressEventHandler);
this._zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_NESTED_TLS_HANDSHAKE_TIMEOUT, this.nestedTLSHandshakeTimeoutEventHandler);


this.logger.trace(`_initialize: ZitiContext '${this._uuid}' initialized`);

Expand Down Expand Up @@ -498,7 +506,10 @@ class ZitiFirstStrategy extends CacheFirst /* NetworkFirst */ {

var regex = new RegExp( this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.self.host, 'g' );
let targetserviceHost = await this._zitiContext.getConfigHostByServiceName (this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.target.service);
let connectAppData = await this._zitiContext.getConnectAppDataByServiceName (this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.target.service);
let connectAppData = await this._zitiContext.getConnectAppDataByServiceName (
this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.target.service,
this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.target.scheme
);
var targetServiceRegex = new RegExp( targetserviceHost , 'g' );
var browzerLoadBalancerRegex = new RegExp( this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.loadbalancer.host , 'g' );

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,10 @@
"@types/emscripten" "^1.39.6"
"@wasmer/wasi" "^1.0.2"

"@openziti/ziti-browzer-core@^0.32.1":
version "0.32.1"
resolved "https://registry.yarnpkg.com/@openziti/ziti-browzer-core/-/ziti-browzer-core-0.32.1.tgz#fc484a4ff90c23c2501788daaf757b063d21b450"
integrity sha512-1KftsTX1k6N3nJRu9x9O3uYtgUvW5esGWlV84XkRIl5+AF/R82jvpLJIi7DVC/Dm+edThM0ltkrvmy967k2XNw==
"@openziti/ziti-browzer-core@^0.33.0":
version "0.33.0"
resolved "https://registry.yarnpkg.com/@openziti/ziti-browzer-core/-/ziti-browzer-core-0.33.0.tgz#b0fe9dc7691dbce68dc1f6f18db9ee4f90946fc4"
integrity sha512-lAducijRv+svCMF6yL8b5L84I4AQAFuR9krj0iTj86y047EzXSSZvTCg+ZABOnoE12/JNQ2CYPzBnAXLqgiWxA==
dependencies:
"@openziti/libcrypto-js" "^0.18.2"
"@openziti/ziti-browzer-edge-client" "^0.6.2"
Expand Down

0 comments on commit b5c9b3d

Please sign in to comment.