A WebSocket server for the Device Control application, enabling real-time communication between controller and target devices.
- Real-time WebSocket communication
- Client connection management
- Message broadcasting
- Connection health monitoring
- Automatic reconnection handling
- CORS enabled
- Health check endpoints
-
Sign up at Render.com (No credit card required)
-
Create a new Web Service:
- Click "New +"
- Select "Web Service"
- Connect your GitHub repository
- Select the branch to deploy
-
Configure the service:
- Name:
device-control-server
- Environment:
Node
- Build Command:
npm install
- Start Command:
node server.js
- Plan: Free
- Name:
-
Environment Variables (optional):
PORT
: Will be set automatically by Render
-
Click "Create Web Service"
Your server will be deployed at https://device-control-server.onrender.com
-
Install dependencies:
npm install
-
Start the server:
npm start
The server will run on http://localhost:3000
GET /
: Server informationGET /health
: Server health statusWSS /
: WebSocket endpoint
CONNECTION_SUCCESS
: Sent when a client successfully connectsERROR
: Sent when an error occurs processing a message
- The free tier may have some limitations on bandwidth and uptime
- The server automatically handles disconnections and reconnections
- Includes ping-pong mechanism to keep connections alive