This repository contains the WebSocket proxy for making Minecraft servers accessible to web clients.
- WebSocket-based Minecraft proxy — browser clients connect via WebSocket; the proxy forwards to Java Minecraft servers (TCP).
- Microsoft/Mojang authentication — makes it possible to connect to official Minecraft servers!
- Connection management & rate limiting — per-IP limits, configurable caps.
- SOCKS proxy support — optional SOCKS5 upstream for outbound connections.
- Signal Server integration — reports to a central server (e.g. signal.mcraft.fun): description, domain, players, CPU, RAM; heartbeat every 10 seconds.
- Prometheus metrics — built-in metrics and enabled-by-default
express-prom-bundlemiddleware. - Callback interface for extensions — e.g. custom connection routing, connection limits, banned origins.
Deploy with a single line of command RIGHT NOW
The recommended way to run an instance is with Docker Compose, using the example that includes automatic updates via Watchtower and an optional env.js mount for config overrides:
Copy it to docker-compose.yml, create env.js if you want external config (see config overrides), then:
docker compose up -dImages are published to GitHub Container Registry (ghcr.io/zardoy/mwc-proxy). The compose file uses a Watchtower service to keep the image updated. The access log is rotated at 100MB and mounted at ./logs so it is preserved on the host. You can override the entrypoint (e.g. to apply tc egress rate limiting) by mounting your own script and setting entrypoint: ["/bin/sh", "/entrypoint.sh"]; your script should end with exec node dist/app.js.
Install:
pnpm add mwc-proxyBuild the project (if you use the source), then:
const { createProxyMiddleware } = require('mwc-proxy')
// or
import { createProxyMiddleware } from 'mwc-proxy'Use createProxyMiddleware(options) with Express. See src/api.ts for ProxyMiddlewareOptions (e.g. urlRoot, allowOrigin, maxConnectionsPerIp, signal, to for host/port allowlist).
CLI entry (standalone server):
npx minecraft-web-proxy
# or
npx mwpEnvironment variables: PORT, URL_ROOT, ALLOW_ORIGIN, MAX_CONNECTIONS_PER_IP, ACCESS_CODE, SIGNAL_SERVER_URL, SIGNAL_DESCRIPTION, SIGNAL_DOMAIN.
You can override the proxy API options (deep-merge) in two ways:
- env.js — Mount or place
env.jsso the CLI loads it, then setglobal.MWC_PROXY_CONFIG_OVERRIDES = { ... }with any ProxyMiddlewareOptions overrides. - CONFIG_OVERRIDES_JSON — Set the env var to a JSON string, e.g.
CONFIG_OVERRIDES_JSON='{"metricsEndpoint":false}'.
Useful for toggling metrics endpoint, auth limits, single-server defaults, etc., without changing code.
For more information and the web client itself, visit the main repo.
For a minimal setup that only bridges WebSocket ↔ TCP (no auth, no Signal Server), you can use the Bun script so your Minecraft server accepts WebSocket connections.
Connect in the client with something like:
wss://ws.your-domain.com- Install Bun
- Copy
ws-proxy.tsto your server (if present in this repo) and edit:YOUR_SERVER_HOSTandYOUR_SERVER_PORT— your Minecraft server.THIS_PUBLIC_IP— public address used for redirects.
- Run with PM2 (or systemctl / another process manager):
pm2 start "bun run ws-proxy.ts" --name bun-proxy
- Not usable on hosters that block SSH or extra ports (e.g. Aternos).
- Intended to run on the same server as the Minecraft server to avoid extra latency; otherwise consider using MWC proxy servers.
