Skip to content

Bugfix: serverOptions.host option is ignored if serverOptions.port is 0 or omitted - #124

Open
arikw wants to merge 1 commit into
agebrock:masterfrom
arikw:patch-1
Open

Bugfix: serverOptions.host option is ignored if serverOptions.port is 0 or omitted#124
arikw wants to merge 1 commit into
agebrock:masterfrom
arikw:patch-1

Conversation

@arikw

@arikw arikw commented Aug 23, 2025

Copy link
Copy Markdown

Resolves #123

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the tunnel TCP server binding logic so serverOptions.host isn’t discarded when serverOptions.port is 0 (ephemeral port) or omitted, addressing the scenario described in issue #123.

Changes:

  • Adjusts the createServer() guard that decides when to pass null vs. a ListenOptions object to net.Server.listen().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread index.js
Comment on lines +18 to 20
if (!serverOptions.port && !serverOptions.host) {
serverOptions = null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The serverOptions.host option is ignored if serverOptions.port is 0 or omitted

2 participants