diff --git a/SERVER_README.md b/SERVER_README.md index 66559c2..ce7c02a 100644 --- a/SERVER_README.md +++ b/SERVER_README.md @@ -36,7 +36,7 @@ npm run dev:server Create a `.env` file in the root directory: ```env -PORT=8080 +PORT=9090 JWT_SECRET_KEY=your-secret-key-here DATABASE_PATH=./data/server.db RELAY_URLS=ws://localhost:8090,ws://relay2.example.com:8090 @@ -49,7 +49,7 @@ Connect to the WebSocket server and send messages in the same format as the brow ### Example: Update Process ```javascript -const ws = new WebSocket('ws://localhost:8080'); +const ws = new WebSocket('ws://localhost:9090'); ws.onopen = () => { ws.send(JSON.stringify({ @@ -127,7 +127,7 @@ WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY server-dist ./server-dist -EXPOSE 8080 +EXPOSE 9090 CMD ["node", "server-dist/server/server.js"] ``` @@ -138,7 +138,7 @@ The server logs all operations with timestamps and client IDs: ``` 🚀 Initializing 4NK Protocol Server... 📡 Connecting to protocol relays... -✅ Server running on port 8080 +✅ Server running on port 9090 📋 Supported operations: UPDATE_PROCESS, NOTIFY_UPDATE, VALIDATE_STATE 🔗 Client connected: client_1234567890_abc123 from 192.168.1.100 📨 Received message from client_1234567890_abc123: UPDATE_PROCESS diff --git a/src/config.ts b/src/config.ts index 27b48f3..a7b9790 100644 --- a/src/config.ts +++ b/src/config.ts @@ -4,7 +4,7 @@ import dotenv from 'dotenv'; dotenv.config(); export const config = { - port: parseInt(process.env.PORT || '8080'), + port: parseInt(process.env.PORT || '9090'), apiKey: process.env.API_KEY || 'your-api-key-change-this', databasePath: process.env.DATABASE_PATH || './data/server.db', relayUrls: process.env.RELAY_URLS?.split(',') || ['ws://localhost:8090'], diff --git a/src/simple-server.ts b/src/simple-server.ts index cd23097..0b961c0 100644 --- a/src/simple-server.ts +++ b/src/simple-server.ts @@ -252,7 +252,7 @@ export class Server { private handlers!: SimpleProcessHandlers; private clients: Map = new Map(); - constructor(port: number = 8080) { + constructor(port: number = 9090) { this.wss = new WebSocket.Server({ port }); this.init(); } @@ -368,5 +368,5 @@ process.on('SIGTERM', () => { }); // Start the server -const port = parseInt(process.env.PORT || '8080'); +const port = parseInt(process.env.PORT || '9090'); const server = new Server(port); \ No newline at end of file diff --git a/test-server.js b/test-server.js index a0c5d5f..375294e 100644 --- a/test-server.js +++ b/test-server.js @@ -2,7 +2,7 @@ const WebSocket = require('ws'); console.log('🔍 Testing WebSocket server connection...'); -const ws = new WebSocket('ws://localhost:8080'); +const ws = new WebSocket('ws://localhost:9090'); ws.on('open', function open() { console.log('✅ Connected to server!');