diff --git a/bin/muse-proxy.mjs b/bin/muse-proxy.mjs index 717aeacedc..d676970e59 100644 --- a/bin/muse-proxy.mjs +++ b/bin/muse-proxy.mjs @@ -18,12 +18,13 @@ import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import { parseProxyPort } from './proxy-port.mjs'; // Default port 18747: 18746 is claimed by design-code-proxy // (DESIGN_CODE_PROXY_PORT) in this repo's config, so muse-proxy takes the // next port in the family range (cf. clef 18742, agy 18743, codex 18744, // antigravity-ls 18745, design-code 18746). -const PORT = parseInt(process.env.MUSE_PROXY_PORT || '18747', 10); +const PORT = parseProxyPort('MUSE_PROXY_PORT', 18747); const HOST = process.env.MUSE_PROXY_HOST || '127.0.0.1'; const EGRESS_PROXY = 'http://hatch-egress-proxy:3128'; diff --git a/bin/proxy-port.test.mjs b/bin/proxy-port.test.mjs index 41cf5cec1d..681191de6e 100644 --- a/bin/proxy-port.test.mjs +++ b/bin/proxy-port.test.mjs @@ -151,13 +151,14 @@ test('clef-proxy binds exactly the requested valid port', async (t) => { assert.equal((await res.json()).port, port); }); -test('all seven parse sites in the five proxies use the shared helper', () => { +test('all eight parse sites in the six proxies use the shared helper', () => { const files = [ 'codex-proxy.mjs', 'clef-proxy.mjs', 'agy-proxy.mjs', 'antigravity-ls-proxy.mjs', - 'design-code-proxy.mjs' + 'design-code-proxy.mjs', + 'muse-proxy.mjs' ]; let sites = 0; for (const file of files) { @@ -174,7 +175,7 @@ test('all seven parse sites in the five proxies use the shared helper', () => { ); sites += source.match(/parseProxyPort\('[A-Z_]+_PROXY_PORT', \d+\)/g).length; } - assert.equal(sites, 7); + assert.equal(sites, 8); }); test('home-manager launches the proxies from the bin directory', () => {