a VPN that is easily self-hostable and resistant to blocking?
from pr3d@eviltoast.org to selfhosted@lemmy.world on 16 Mar 07:57
https://eviltoast.org/post/25539021

Hi, i’m looking for a VPN that:

github.com/TrustTunnel/TrustTunnel sounds interesting, but the PR for docker compose was closed.

Do you know something else?

#selfhosted

threaded - newest

irmadlad@lemmy.world on 16 Mar 08:16 next collapse

resistant to blocking?

That’s going to be the sticky wicket right there. It is rather trivial for server admins to know what IPs go with VPNs and not. Wireguard is about the best thing on the planet right now, imho, but it will also get blocked. Occasionally, I will happen on a site that outright blocks me. If I can’t bend the site to my will, I just move on. The information on the blocked site will 9 times out of 10 be found duplicated somewhere else.

One ‘trick’ I’ve found works fairly well is Opera. So, when I go to pay my bills online, my VPN coupled with the way I have Firefox configured, will trigger a block. I can fire up Opera, engage it’s built in VPN, still keep my local VPN connected, and have no problem accessing my bills. It’s not an elegant solution, and some users have preclusions to Opera. However, that generally works for me.

iopq@lemmy.world on 16 Mar 10:14 collapse

Wireguard is not resistant to blocking, it is plain as day if you’re using wireguard and china had blocked it for years

irmadlad@lemmy.world on 16 Mar 10:26 collapse

I sort of said as much. It really doesn’t matter, imho, what you use. As soon as that service becomes abused globally, everyone blocks it, including Tor. Any server using DPI or TLS will spot it a mile away. Now, if you have a fool proof way, than I am very much ready to be educated.

iopq@lemmy.world on 16 Mar 23:41 collapse

It does matter.

When I connect to my VPN, the network sees that the server name is yahoo.com

It actually connects to my server which sends the request to yahoo.com and then replies with the cert. So the network sees that yahoo.com sent the cert back to my client from that IP address

Then there is a bunch of encrypted communication with timings and sizes that look like I’m downloading stuff over http.

I’d like to hear a credible model of blocking this

meme_historian@lemmy.dbzer0.com on 16 Mar 08:29 next collapse

Wireguard on a VPS and run it through port 443. That should get you through most things that don’t do TLS inspection

iopq@lemmy.world on 16 Mar 10:17 collapse

So, not resistant to blocking

spaghettiwestern@sh.itjust.works on 16 Mar 09:30 next collapse

I’ve run Wireguard on 443 (on my router) for exactly that purpose and never had a problem, even when my standard WG port was blocked by some businesses. I’ve since had to move to port 587 due to router conflicts and it’s worked fine so far too.

The battery drain on Android is negligible (at least for my uses) and WG is activated by Tasker whenever my home wifi is out of range. From what I can see WG is configurable via Docker compose.

hellmo_luciferrari@lemmy.zip on 16 Mar 09:50 next collapse

Have you tried [github.com/zaneschepke/wgtunnel](WG Tunnel)

I use this WG client and it has options for auto-tunneling

spaghettiwestern@sh.itjust.works on 16 Mar 12:11 collapse

Thanks for the link. Will take a look.

hellmo_luciferrari@lemmy.zip on 16 Mar 12:47 collapse

I quite like the option! I do love tasker, but if i only need auto tunneling this does it quite well!

iopq@lemmy.world on 16 Mar 10:13 collapse

Doesn’t work in China, can be easily blocked by censors

spaghettiwestern@sh.itjust.works on 16 Mar 12:11 next collapse

Who said anything about China?

OP: “I don’t need strong censorship resistance; it just has to work in offices and hotel WiFis.”

moonpiedumplings@programming.dev on 16 Mar 20:00 collapse

Many of the prominent https VPN protocols are for evading the great firewall of China. OP had that as a requirement, so it is not an unreasonable assumption.

If you are evading less locked down firewalls, then you don’t need as stealthy VPNs.

spaghettiwestern@sh.itjust.works on 16 Mar 20:15 collapse

Many of the prominent https VPN protocols are for evading the great firewall of China. OP had that as a requirement

OP said exactly the opposite. Where the fuck do you get this stuff?

moonpiedumplings@programming.dev on 16 Mar 20:35 collapse

hides as regular HTTPS traffic so it’s not blockable by Firewalls

From OP’s post, of course. If OP does not need to evade firewalls that are that aggressive, then they should have settled for a less stealthy VPN solution, as many of these HTTPS proxy solutions have performance and usability (can often only proxy TCP traffic) tradeoffs.

Perhaps they have already tried the wireguard on port 443 solution, and it didn’t work for them. My high school would auto detect and block wireguard to any port. Perhaps they are in a similar situation.

pr3d@eviltoast.org on 18 Mar 11:42 collapse

I haven’t tried WG on 443/udp yet. On my last UK journey I had it on the default WG port and it was blocked a few times. Will try 443/udp @ homelab next time. Every other advanced obfuscating solution sounds pretty complicated and I’m not sure if there will be time to handle this during a journey.

moonpiedumplings@programming.dev on 18 Mar 12:54 collapse

Also try wireguard over port 53. Often (udp) traffic to port 53 is unblocked because it’s needed for DNS.

What is special about this setup is that it can sometimes get around captive portal wifi.

pr3d@eviltoast.org on 18 Mar 14:14 collapse

Pretty nice idea! Will try it. Thanks.

sunbeam60@feddit.uk on 16 Mar 12:44 next collapse

Most Chinese exits through port snooping. And you really need to be on a Chinese corp network to know - if you take your western mobile there they do very little blocking.

I’ve been fairly successful with most China corp networks letting me out and in to self-hosted WG server on port 123.

iopq@lemmy.world on 16 Mar 23:33 collapse

Because if you’re roaming it creates a VPN, basically through the Chinese network

But it you want a lot of data, like for YouTube, you’re not going to want to pay roaming rates

eleitl@lemmy.zip on 17 Mar 03:07 collapse

Russia has harsher blocks than China, meanwhile.

iopq@lemmy.world on 18 Mar 01:05 collapse

Yes, they actually block legitimate websites too, apparently

iopq@lemmy.world on 16 Mar 10:16 next collapse

Use xray. I suggest the REALITY + XHTTP setup where you look like another h2 server

You can docker compose your panel for managing your server, get a free subdomain from afraid.org and set up tls on it

I use the v2rayng mobile app since I don’t switch servers much, I only have two

pr3d@eviltoast.org on 16 Mar 11:49 collapse

the repos i’ve found do not look very trustworthy. github.com/2dust/v2rayNG github.com/XTLS/Xray-core well its chinese

moonpiedumplings@programming.dev on 16 Mar 19:51 next collapse

Yes because they are all designed to evade the great firewall of China, which automatically catches almost all other VPN’s and proxies.

Github is blocked in China. The fact that these repos are on Github and Chinese is proof of their effectiveness.

iopq@lemmy.world on 16 Mar 23:35 collapse

Xray-core is the one you want, very hard to block

Decronym@lemmy.decronym.xyz on 16 Mar 10:30 next collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
HTTP Hypertext Transfer Protocol, the Web
HTTPS HTTP over SSL
IP Internet Protocol
SSL Secure Sockets Layer, for transparent encryption
TCP Transmission Control Protocol, most often over IP
TLS Transport Layer Security, supersedes SSL
UDP User Datagram Protocol, for real-time communications
VPN Virtual Private Network
VPS Virtual Private Server (opposed to shared hosting)

9 acronyms in this thread; the most compressed thread commented on today has 14 acronyms.

[Thread #171 for this comm, first seen 16th Mar 2026, 17:30] [FAQ] [Full list] [Contact] [Source code]

moonpiedumplings@programming.dev on 16 Mar 11:05 next collapse

It’s not quite a VPN, but it is very resistant against blocking:

programming.dev/comment/22662028

pr3d@eviltoast.org on 16 Mar 11:46 collapse

ok, not what i’ve been looking for, but they provide a docker-compose.yaml. Looks simple

cmnybo@discuss.tchncs.de on 16 Mar 11:46 next collapse

You can use stunnel to make your VPN look like HTTPS.

devtoolkit_api@discuss.tchncs.de on 16 Mar 12:38 next collapse

For your exact use case (hiding as HTTPS, Docker, works behind restrictive firewalls), I would strongly recommend looking at:

  1. WireGuard + wstunnel — WireGuard itself is great but easily blocked. Wrapping it in wstunnel makes it look like regular WebSocket/HTTPS traffic. Docker-compose setup is straightforward.

  2. Cloak + OpenVPN/Shadowsocks — Cloak is specifically designed to make VPN traffic look like normal HTTPS to a CDN. Very effective against DPI.

  3. Headscale (self-hosted Tailscale control server) — not inherently resistant to blocking, but combined with a DERP relay behind Caddy, it works well on most networks. The Tailscale Android app is excellent on battery life.

For the Caddy coexistence requirement specifically, wstunnel is probably your best bet since it literally runs as a WebSocket endpoint that Caddy can reverse proxy alongside your regular sites.

I have been running a similar setup (WireGuard over wstunnel behind Caddy) on a small VPS and it has worked through hotel and airport WiFi without issues.

black_flag@lemmy.dbzer0.com on 16 Mar 13:22 next collapse

Amnezia?

BiggestPiggest@lemmy.world on 17 Mar 01:06 collapse

Yeah. This.

ikidd@lemmy.world on 16 Mar 15:30 next collapse

You can obfuscate Wireguard with a SOCKS proxy.

Drusenija@aussie.zone on 17 Mar 01:50 next collapse

My go to choice for this is ocserv to run a Cisco AnyConnect server, and sniproxy to sit on port 443 and handle traffic routing. You configure sniproxy to go to a different server by hostname, and configure ocserv as the fallback option to access the VPN. Any host I expose via sniproxy provides its own HTTPS certificate via my Traefik server.

black0ut@pawb.social on 17 Mar 02:58 next collapse

If you want a decently hidden VPN, I recommend setting up an OpenVPN instance, with a TCP tunnel, encapsulated within Stunnel. It manages to stay hidden even with DPI.

The setup is a bit convoluted, especially if you want everything to use certificates for maximum security. It’s also not the fastest VPN, and TCP isn’t the most efficient for a VPN. But it’s decent enough for a normal user.

You can set it up on both Linux and Windows, even having both ends of the tunnel on Windows, but it’s easier and better to set it up on Linux.

mlg@lemmy.world on 18 Mar 02:04 collapse

(I don’t need strong censorship resistance; it just has to work in offices and hotel WiFis.

Wireguard on 443 or OpenVPN + Stunnel on 443

Wireguard is easier to setup because there’s no OpenVPN app that packages stunnel (afaik), so you have to run 2 apps on your phone to make it work.

A server like caddy can also accept HTTPS traffic for some regular websites next to the VPN server.

Wireguard uses UDP, so just run whatever you want on 443 TCP with caddy (unless you want QUIC for some reason?)

Anything beyond that and you’d be looking at using a proper obfuscation solution like Shadowsocks or obfs4, in which case you should look into Amnezia or Tor bridges.

pr3d@eviltoast.org on 18 Mar 11:30 collapse

I think I will stick to wireguard on port 443/udp. Hope UDP is open in strict networks. Maybe someone hasn’t heard of HTTP/3.

Everything else sounds not necessary because I don’t travel to china or similar. stunnel needs termux on android in-between? This adds too many moving parts IMO.

AmneziaWG will enter wg-easy in v16 and WG Tunnel already supports it. Don’t know how hard it it to configure, but the Jc, Jmin, Jmay, … settings in WG Tunne look confusing.