MASQUE-style HTTP/3 CONNECT proxy for MikroTik RouterOS x86_64 containers.
3.1K
MASQUE-style HTTP/3 CONNECT proxy for MikroTik RouterOS x86_64 containers.
Based on Alpine Linux. Self-generated CA + mutual TLS. Env-driven user management. Designed for the NekoBox / sing-box MASQUE client.
| Layer | Size |
|---|---|
| Compressed (Docker Hub) | ~7 MB |
| Unpacked (on device) | ~20 MB |
Built with multi-stage build — only the Go binary + Alpine + openssl in the final image. No Go toolchain, no build artifacts.
h3). TCP tunneling only.CLIENT_NAMES env var — the single source of truth.
On every start the container issues certs for new names, revokes names that
were removed, and writes a ready-to-import .masque bundle per user./interface/veth add address=172.16.168.2/24 gateway=172.16.168.1 name=veth-masque
/interface/bridge/port add bridge=Bridge-Docker interface=veth-masque
/container/envs/add list=masque-env key=LISTEN_ADDR value=0.0.0.0:4433
/container/envs/add list=masque-env key=SERVER_PUBLIC_ADDR value=your-ip-or-domain:4433
/container/envs/add list=masque-env key=CERT_CN value=masque.local
/container/envs/add list=masque-env key=CLIENT_NAMES value=phone,laptop
| Variable | Required | Description |
|---|---|---|
SERVER_PUBLIC_ADDR | Yes | Public ip:port or domain:port written into client .masque |
CLIENT_NAMES | Yes | Comma-separated user names. Empty = no users, server refuses all |
CERT_CN | No | Cert CN + client server_name. Default masque.local |
CERT_SAN | No | Cert SAN list. Default DNS:$CERT_CN,DNS:localhost,IP:127.0.0.1 |
LISTEN_ADDR | No | Listen address. Default 0.0.0.0:4433 |
CLIENT_MTU | No | MTU written into client .masque. Default 1280 |
Using a domain instead of an IP is recommended: on a server move you only update the DNS A-record — client
.masquefiles stay valid.
/container/mounts/add list=masque-cert src=/usb1/masque/cert dst=/app/cert
/container/mounts/add list=masque-clients src=/usb1/masque/clients dst=/app/clients
Without these mounts the CA, server cert and per-user .masque files are
regenerated on every restart — clients would break after each restart.
/container/add \
remote-image=ulfrasark/masque-server:latest \
interface=veth-masque \
envlist=masque-env \
mountlists=masque-cert,masque-clients \
root-dir=/usb1/masque \
dns=1.1.1.1 \
start-on-boot=yes \
logging=yes
/container/start [find image~"masque-server"]
/log print where topics~"container"
On startup the container prints the CA fingerprint, issues client certs, and
writes each .masque bundle:
[entrypoint] CA fingerprint: sha256 Fingerprint=...
[entrypoint] issuing client 'phone'
[entrypoint] wrote /app/clients/phone.masque
[entrypoint] allow: phone = a1b2c3d4...
HTTP/3 CONNECT proxy on 0.0.0.0:4433 (mTLS, allow-list /app/clients/allowed.txt)
| Action | How |
|---|---|
| Add | Add name to CLIENT_NAMES, restart. New <name>.masque is generated. |
| Revoke | Remove name from CLIENT_NAMES, restart. Cert + bundle deleted, dropped from allow-list — the old .masque can no longer connect. |
| Fetch | Grab /usb1/masque/clients/<name>.masque (WinBox → Files). |
Revocation is enforced at the TLS handshake: a removed user's certificate is no longer in the allow-list, so the server rejects it even though it still chains to the CA.
| Port | Protocol | Required |
|---|---|---|
| 4433 | UDP | Always (QUIC / HTTP/3 transport) |
Import the generated .masque bundle, or fill the MASQUE node fields from it:
server_addr = "your-ip-or-domain:4433"
server_name = "masque.local"
insecure_skip_verify = false
ca_pem = """ ...server CA... """
cert_pem = """ ...client cert... """
key_pem = """ ...client key... """
Set
insecure_skip_verify = falseso the client verifies the server, and keepcert_pem/key_pemso the server verifies the client (mutual TLS).
This server tunnels TCP only, so plain UDP DNS through the proxy will fail. Use DoH in your client — it travels as HTTPS/TCP through the tunnel:
remoteDns = https://1.1.1.1/dns-query
DoH keeps DNS encrypted, routes it through the tunnel (no DNS leak), and defeats
DNS-based blocking. A local DNS also works but resolves outside the tunnel.
Source and Dockerfile: coming soon
Content type
Image
Digest
sha256:129d4f3ad…
Size
7 MB
Last updated
about 1 month ago
docker pull ulfrasark/masque-vpn