I have no clue what im doing help

I’m setting up a self-hosted Moonlight streaming server on Windows that can be accessed securely through Cloudflare Tunnels and use a TURN server (coturn) on an Oracle VPS to relay WebRTC traffic, even on restricted Wi-Fi networks like at school.

Architecture

Local machine (Windows):

Runs web-server.exe from Moonlight with HTTPS on 127.0.0.1:8080.

Cloudflare Tunnel (cloudflared) forwards brianlaoisagoat.org https://127.0.0.1:8080.

Config:

tunnel: d370b035-b615-4767-80b8-6e26a721cc40
credentials-file: C:\Users\Bino.cloudflared\d370b035-b615-4767-80b8-6e26a721cc40.json
protocol: http2
ingress:
  • hostname: brianlaoisagoat.org
    service: https://127.0.0.1:8080
  • service: http_status:404
    Remote VPS (Oracle Cloud, Ubuntu):
Hosts a coturn TURN server in Docker with host networking:

sudo docker run -d --network host --name coturn \
-v /etc/turnserver:/etc/turnserver \
coturn/coturn:4.6.2 \
--lt-cred-mech --fingerprint --no-cli \
--realm brianlaoisagoat.org \
--cert /etc/turnserver/cert.pem \
--pkey /etc/turnserver/key.pem \
--user turnuser:MMd0aLbGu4mp14HXhTglmPbq \
--min-port 49152 --max-port 49200 --verbose


Ports 443 and 3478 (TCP+UDP) are open in ufw and Oracle’s firewall.

Uses a Cloudflare Origin Certificate for TLS (/etc/turnserver/cert.pem and key.pem).

Domain: brianlaoisagoat.org

Managed on Cloudflare.

Root record is proxied (orange cloud).

SSL mode: Full (Strict).

Tunnel created and linked successfully.

What’s Working


Local Moonlight web server works perfectly when accessed on https://127.0.0.1:8080.

Domain brianlaoisagoat.org resolves and loads through HTTPS.

TURN server (coturn) listens correctly on 443 and 3478 (TCP/UDP) on the VPS.

When visiting the website externally through Cloudflare, I sometimes get “Host Error(Cloudflare 521/502).

Trickle ICE tests fail with 701 Failed to establish connection on both:

turns:brianlaoisagoat.org:443?transport=tcp
turn:brianlaoisagoat.org:3478?transport=udp
Was this page helpful?