Skip to content

fix: use fixed default port 45678 instead of random#33

Open
Boudbois2271 wants to merge 1 commit into
MrCyjaneK:masterfrom
Boudbois2271:fix/default-port
Open

fix: use fixed default port 45678 instead of random#33
Boudbois2271 wants to merge 1 commit into
MrCyjaneK:masterfrom
Boudbois2271:fix/default-port

Conversation

@Boudbois2271

@Boudbois2271 Boudbois2271 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the random port selection (2000 + rand.Intn(10000)) with a fixed default of 45678
  • Port 45678 sits above the range used by common development tools and well below the OS ephemeral port range (49152+), minimising collision risk
  • The existing SPort override mechanism is unchanged — users who need a custom port can still set it

Motivation

A random port on every restart makes it impossible to bookmark the app or use stable URLs. A fixed default gives a reliable entry point with no configuration needed.

Test plan

  • Build and run with no SPort set — server starts on 45678
  • Build and run with SPort set to another value — server uses that value instead
  • Confirm rand import removed (no longer needed)

Random port selection made it impossible to bookmark the app or
rely on a stable URL across restarts. Port 45678 is above the range
used by common software and below the OS ephemeral port range (49152+).

SPort override behaviour is unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant