Skip to content

Commit 48307c6

Browse files
waleedlatif1claude
andcommitted
chore(realtime): remove unused SOCKET_PORT env var
SOCKET_PORT has lived in the socket server since the June 2025 refactor but was never actually set in any deploy config — docker-compose.prod, helm values/templates, .env.example, and docs all use PORT or the 3002 default exclusively. No self-hoster was ever pointed at SOCKET_PORT, so removing it is safe. Simplifies realtime port resolution to `env.PORT` (zod-validated with a 3002 default) and drops the orphaned sim-side schema entry. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 86dbab6 commit 48307c6

3 files changed

Lines changed: 1 addition & 3 deletions

File tree

apps/realtime/src/env.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const EnvSchema = z.object({
1010
NEXT_PUBLIC_APP_URL: z.string().url(),
1111
ALLOWED_ORIGINS: z.string().optional(),
1212
PORT: z.coerce.number().int().positive().default(3002),
13-
SOCKET_PORT: z.coerce.number().int().positive().optional(),
1413
DISABLE_AUTH: z
1514
.string()
1615
.optional()

apps/realtime/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function createRoomManager(io: SocketIOServer): Promise<IRoomManager> {
2929

3030
async function main() {
3131
const httpServer = createServer()
32-
const PORT = Number(env.SOCKET_PORT ?? env.PORT ?? 3002)
32+
const PORT = env.PORT
3333

3434
logger.info('Starting Socket.IO server...', {
3535
port: PORT,

apps/sim/lib/core/config/env.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ export const env = createEnv({
248248

249249
// Real-time Communication
250250
SOCKET_SERVER_URL: z.string().url().optional(), // WebSocket server URL for real-time features
251-
SOCKET_PORT: z.number().optional(), // Port for WebSocket server
252251
PORT: z.number().optional(), // Main application port
253252
INTERNAL_API_BASE_URL: z.string().optional(), // Optional internal base URL for server-side self-calls; must include protocol if set (e.g., http://sim-app.namespace.svc.cluster.local:3000)
254253
ALLOWED_ORIGINS: z.string().optional(), // CORS allowed origins

0 commit comments

Comments
 (0)