Skip to content

Commit b78f1d6

Browse files
fix(app): use fixed default port for open command (#10)
Change the command to use port 4097 by default instead of an ephemeral port.
1 parent fd7366e commit b78f1d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/app/src/cmd/open.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { createApp, type ServerConfig } from '../server/app';
55

66
const LOOPBACK_ADDRESSES = new Set(['127.0.0.1', 'localhost', '::1', '[::1]']);
77
const DEFAULT_HOST = '127.0.0.1';
8+
const DEFAULT_PORT = 4097;
89
const HEALTH_CHECK_MAX_RETRIES = 10;
910
const HEALTH_CHECK_BACKOFF_MS = 100;
1011

@@ -89,8 +90,9 @@ export const openCommand: CommandModule<object, OpenOptions> = {
8990
})
9091
.option('port', {
9192
type: 'number',
92-
describe: 'Fixed port (default: ephemeral)',
93-
alias: 'p'
93+
describe: 'Port to listen on',
94+
alias: 'p',
95+
default: DEFAULT_PORT
9496
})
9597
.option('host', {
9698
type: 'string',
@@ -115,7 +117,7 @@ export const openCommand: CommandModule<object, OpenOptions> = {
115117

116118
async function runOpen(argv: OpenOptions): Promise<void> {
117119
const host = argv.host;
118-
const port = argv.port ?? 0; // 0 = ephemeral port
120+
const port = argv.port;
119121
const token = generateToken(); // Always generate token for defense-in-depth
120122

121123
// Security: --expose and --web together is not allowed (SSRF protection)

0 commit comments

Comments
 (0)