Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/cli-standalone.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ program
.description('Node.js client for the relay tunnel service')
.version('1.4.2');

// Libère le raccourci -h pour l'option --host et déplace l'aide sur -H
program.helpOption('-H, --help', 'Display help for command');

program
.command('set-token <token>')
.description('Save an authentication token for future use')
Expand Down
3 changes: 3 additions & 0 deletions src/cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ program
.description('Node.js client for the relay tunnel service')
.version('1.5.1');

// Libère le raccourci -h pour l'option --host et déplace l'aide sur -H
program.helpOption('-H, --help', 'Display help for command');

program
.command('set-token <token>')
.description('Save an authentication token for future use')
Expand Down
10 changes: 7 additions & 3 deletions src/tunnel/tunnel-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ function startHeartbeatMonitoring(socket, lastHeartbeatReceived) {

export async function connectAndServe(options, failureTracker = null) {
debug('Starting tunnel service');


// Normalize local host value early so it can be reused consistently
const localHost = options.host || 'localhost';
options.host = localHost;

// Validate and use user-defined timeout or default to 30 seconds
let timeoutSeconds = parseInt(options.timeout);
if (isNaN(timeoutSeconds) || timeoutSeconds < 1 || timeoutSeconds > 300) {
Expand Down Expand Up @@ -321,9 +325,9 @@ export async function connectAndServe(options, failureTracker = null) {
// For TCP: publicAddr is like "tcp.relais.dev:12345" -> we need host and port separately
const [publicHost, publicPort] = publicAddr.split(':');
const tunnelTypeLabel = options.type === 'tcp' ? 'TCP' : 'HTTP';

tunnelHealthChecker = new TunnelHealthChecker({
localHost: options.host || 'localhost',
localHost,
localPort: parseInt(options.port),
tunnelType: options.type || 'http',
publicUrl: publicHost,
Expand Down
Loading