@tmlmobilidade/ssh 20260617.1318.33 → 20260617.1703.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,26 +48,26 @@ export class SshTunnelService {
|
|
|
48
48
|
return this._server;
|
|
49
49
|
}
|
|
50
50
|
const [server] = await createTunnel(this.config.tunnelOptions, this.config.serverOptions, this.config.sshOptions, this.config.forwardOptions);
|
|
51
|
-
Logger.info(`SSH Tunnel connected to host port ${server.address().port}`);
|
|
51
|
+
Logger.info({ message: `SSH Tunnel connected to host port ${server.address().port}` });
|
|
52
52
|
this._server = server;
|
|
53
53
|
server.on('error', (error) => {
|
|
54
|
-
Logger.error(
|
|
54
|
+
Logger.error({ error, message: 'SSH Tunnel Error' });
|
|
55
55
|
});
|
|
56
56
|
server.on('close', () => {
|
|
57
|
-
Logger.info('SSH Tunnel closed.');
|
|
57
|
+
Logger.info({ message: 'SSH Tunnel closed.' });
|
|
58
58
|
});
|
|
59
59
|
return this._server;
|
|
60
60
|
}
|
|
61
61
|
catch (error) {
|
|
62
62
|
if (error.code === 'EADDRINUSE') {
|
|
63
|
-
Logger.info(`Port "${this.config.serverOptions.port}" already in use. Retrying with a different port...`);
|
|
63
|
+
Logger.info({ message: `Port "${this.config.serverOptions.port}" already in use. Retrying with a different port...` });
|
|
64
64
|
this.config.serverOptions.port++;
|
|
65
65
|
return await this.connect();
|
|
66
66
|
}
|
|
67
67
|
else if (this.retries < (this.options?.maxRetries || 3)) {
|
|
68
|
-
Logger.error(
|
|
68
|
+
Logger.error({ error, message: 'Failed to connect to SSH Tunnel.' });
|
|
69
69
|
this.retries++;
|
|
70
|
-
Logger.info('Retrying SSH connection...');
|
|
70
|
+
Logger.info({ message: 'Retrying SSH connection...' });
|
|
71
71
|
return await this.connect();
|
|
72
72
|
}
|
|
73
73
|
else {
|