Overview
Proxy servers enable the Minecraft Web Client to connect to Java Minecraft servers using the TCP protocol. The proxy creates a WebSocket connection between your browser and the Minecraft server, bridging the protocol gap without any packet deserialization.The proxy server simply forwards packets between the client and Minecraft server without processing them. All Minecraft protocol packets are handled directly in your browser.
How Proxies Work
When you connect to a server through a proxy:- Your browser establishes a WebSocket connection to the proxy server
- The proxy connects to the Minecraft server via TCP
- All packets are forwarded in both directions without modification
- Your browser processes all Minecraft protocol packets directly
Self-Hosting a Proxy
Quick Start
Start the Proxy Server
Run the production server:The proxy will be available at
http://localhost:8080Server Configuration
The proxy server (server.js) accepts several configuration options:
Command Line Arguments
--prod- Run in production mode--log- Enable connection logging--timeout <ms>- Set connection timeout (default: 10000ms)- Port number - Specify custom port (default: 8080)
Environment Variables
Configuration File
The proxy reads fromconfig.json to set defaults:
public/config.json:
Setting
defaultProxy to an empty string tells the client to use the current server URL as the proxy.Cloud Deployment
Deploy to Koyeb
Click the button below for one-click deployment:Other Platforms
The proxy can be deployed to any platform supporting Node.js or Docker:- Heroku: Use the included
Dockerfile.proxy - Railway: Connect your GitHub repository
- Vercel: Limited support (WebSocket restrictions)
- VPS: Any Linux server with Node.js 18+
Example: Deploy to VPS
Example: Deploy to VPS
mwc-proxy: Standalone Proxy
For making your own Minecraft server accessible to web clients, use mwc-proxy - a lightweight WebSocket proxy.Features
- Runs alongside your Minecraft server
- Minimal resource usage
- Direct connections via
wss://play.example.com - Automatic client detection via
?client_mcraftURL parameter
Installation
Configuration
Running
CORS Configuration
For proper proxy operation, ensure CORS headers are configured:allowOrigin: '*').
Monitoring and Logs
Enable logging to monitor connections:- New WebSocket connections
- Minecraft server connections
- Connection errors and timeouts
- Disconnections
Troubleshooting
Connection Timeout
Connection Timeout
Increase the timeout value if connecting to distant servers:
CORS Errors
CORS Errors
Ensure your proxy has CORS enabled and accepts requests from your web client domain.
High Latency
High Latency
Use a proxy server geographically close to both you and the Minecraft server for best performance.
WebSocket Connection Failed
WebSocket Connection Failed
- Check firewall rules allow outbound WebSocket connections
- Verify the proxy server is running and accessible
- Ensure you’re using the correct protocol (ws:// or wss://)
Security Considerations
Rate Limiting Example
Next Steps
- Docker Deployment - Deploy using Docker containers
- Debugging - Debug proxy connections and packets
- Contributing - Contribute to the proxy code
