Skip to content

Commit

Permalink
Update platform.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Dec 30, 2023
1 parent 5be56b7 commit 8985446
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,21 @@ export class CloudflaredTunnelPlatform implements DynamicPlatformPlugin {
*/
async discoverDevices() {
try {
this.debugLog(JSON.stringify(this.config));
this.log.info(JSON.stringify(this.config));
const url = this.config.url || `${this.config.protocol}://${this.config.hostname}:${this.config.port}`;
//Default: {protocol}://{hostname}:{port}
//The local server URL to tunnel.
let tunnel: Tunnel | undefined;
if (this.config.startTunnelAuto) {
tunnel = await startTunnelAuto({ url: url, verifyTLS: this.config.verifyTLS });
} else {
tunnel = await startTunnel({ url: url, verifyTLS: this.config.verifyTLS });
}
//let tunnel: Tunnel | undefined;
//if (this.config.startTunnelAuto) {
const tunnel = await startTunnelAuto({ url: url, verifyTLS: this.config.verifyTLS });
//} else {
// tunnel = await startTunnel({ url: url, verifyTLS: this.config.verifyTLS });
//}
const output = execSync('yes', { encoding: 'utf-8' });
const output2 = execSync('confirm', { encoding: 'utf-8' });
this.infoLog(`Tunnel URL: ${tunnel}, Output was:\n ${output}${output2}`);
this.log.info(`Tunnel URL: ${tunnel}, Output was:\n ${output}${output2}`);
} catch {
this.errorLog('Failed to Start Tunnel');
this.log.error('Failed to Start Tunnel');
}
}

Expand Down

0 comments on commit 8985446

Please sign in to comment.