Server Websocket
Servers
Server Websocket
GET
Server Websocket
Upgrades the connection to a websocket for real-time server console output, statistics, and command execution.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pterodactyl/wings/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
Requires a JWT token in the query string or as a bearer token. This endpoint uses different authentication than other API endpoints - it requires a signed JWT issued by the Panel, not the Wings authentication token.Path Parameters
The UUID of the server
Connection Limits
- Maximum 30 concurrent websocket connections per server
- Connections are tracked across all users
- Exceeding the limit returns a 400 error
Rate Limiting
Global rate limit: 10 messages per 200ms (50 messages/second)- When throttled, clients receive a
throttledevent with args["global"] - Individual message types have additional rate limits
Message Format
All websocket messages use JSON format:Client → Server Events
Messages sent from client to server to control the server or request data.send command
Send a command to the server console.send logs
Request historical console logs.send stats
Request current server statistics.set state
Change server power state.Server → Client Events
Events sent from server to client with real-time updates.console output
Real-time console output from the server.status
Server state changes.stats
Server resource utilization updates (sent periodically).token expiring
Notifies client that JWT is about to expire.token expired
Notifies client that JWT has expired.daemon message
System messages from Wings daemon.install output
Installation progress output.install started
Installation process has begun.install completed
Installation process completed.Error Responses
400 Bad Request
Too many open websocket connections (limit: 30 per server).
404 Not Found
The requested server does not exist on this Wings instance.
Suspension Handling
If the server is suspended:- Websocket connection is established
- Immediately receives a close message with code 4409
- Close message: “server is suspended”
- Connection is terminated
Connection Lifecycle
- Client connects with valid JWT
- Connection is established and tracked
- Client receives real-time events
- Connection closes on:
- Client disconnect
- Server deletion
- Server suspension
- Context cancellation
- JWT expiration
Example Connection (JavaScript)
Close Codes
Expected close codes:1000- Normal closure1001- Going away1006- Abnormal closure (no close frame)1012- Service restart4409- Server suspended (custom code)
Notes
- JWT authentication is separate from Wings bearer token authentication
- Connection tracking is server-wide, not per-user
- Messages larger than 32KB are dropped
- Only text messages are accepted (binary messages are ignored)
- Invalid JSON messages are silently discarded
- Message size limit: 4KB compressed, 32KB uncompressed
- Rate limiting is enforced globally and per-message-type
Source Reference
Implemented inrouter/router_server_ws.go:27