Update default port to 9090
This commit is contained in:
parent
e98dbaca8d
commit
7c4e81331b
@ -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
|
||||
|
@ -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'],
|
||||
|
@ -252,7 +252,7 @@ export class Server {
|
||||
private handlers!: SimpleProcessHandlers;
|
||||
private clients: Map<WebSocket, string> = 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);
|
@ -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!');
|
||||
|
Loading…
x
Reference in New Issue
Block a user