You run your own media server at home. Your films are on it, you reach it from your
phone over a VPN, and it all works. Then you are at a friend's place, there is a big
TV, and you think: let's watch something of mine.
That is the moment a well-locked home network gets its first hole. Not because anyone
is careless, but because of how casting works.
Why can't the TV just play what's on my phone?
Because when you cast, the phone does not send the film. It sends an address.
Casting (to a Chromecast, or to a smart TV over DLNA) works like handing someone a
note that says "the film is over there, go get it." The TV then fetches the film
itself, straight from your media server. Your phone is just the remote control.
At home that is great: the TV and the server are on the same network, so the TV can
walk over and get it. At a friend's house, the TV is on their network. Your server is
on yours. The note points somewhere the TV cannot reach.
Your phone can reach home, because it runs your VPN tunnel (in my case WireGuard). The
TV cannot. It has no tunnel, and you cannot install one on most TVs.
What are the usual fixes, and what do they cost?
There are three, and each one opens something.
- Open the server to the internet. Turn on your media server's remote access and forward a port on your router, so the TV can fetch from your public address. It works, and now your server answers anyone on the internet who knocks.
- Put the TV on your network. Route your friend's network into yours, or bridge your tunnel to their Wi-Fi. Now their TV, and anything else on their network, can see your NAS, your router and everything else at home.
- Give them your account. Log the TV into your server with your credentials. Now a device you do not control holds the keys, and keeps them after you leave.
All three solve the problem the same way: they build a road from the TV to your home.
And a road does not care what drives on it.
The rule: serve the thing, not the road
Here is the idea that fixes it, and it works far outside media servers.
When an untrusted device needs one thing from your private network, bring that one
thing out to it. Don't give it a way in.
Your phone is the only device on both networks. It can reach home through the tunnel,
and it can reach the TV on the local Wi-Fi. So instead of handing the TV an address
back home, the phone fetches the film itself and serves it to the TV, like a small
temporary shop that stocks exactly one item.
The difference matters:
- A router passes traffic between networks. Whatever the TV asks for, it can try to reach.
- A relay that serves answers only for the files it chose to offer. The TV can ask for your router's login page all night; there is nothing behind the counter.
A few details make the shop safe rather than just convenient:
- One link per film, with a random token in it, so nobody on their Wi-Fi can guess the address, and the link dies when you press Stop.
- The credentials never leave the phone. The TV gets a film, not your login.
- Nothing new is opened at home. The tunnel you already run is the only way in, and only your phone uses it.
The same rule shows up elsewhere once you look for it. Sharing one file with a
colleague? Send the file, not access to your drive. A plumber needs the boiler room?
Open the boiler room, not the whole house. Security people call it least privilege.
In plain words: hand over what is needed, and nothing that leads further.
What does this look like in practice?
I wanted this setup badly enough that I built an Android app for it: Ferry. It sits on
the phone, connects home over your WireGuard tunnel, and serves the film you pick to a
Chromecast, a smart TV over DLNA, or any browser through a QR code or short link. No
routing between the networks, no extra ports to open at home, and your Plex token
stays on the phone.
I won't repeat the setup here. The complete walk-through (the media server, the
WireGuard tunnel, and the app) is a step-by-step guide on Ferry's site:
Set up Plex with WireGuard and Ferry, step by step.
What are the limits?
Being honest about where this stops:
- Your phone has to stay in the room and on. It is the shop. If it leaves, the film stops. That is the price of nothing being left behind.
- Your home upload speed sets the ceiling. The film still travels from your house to the phone over the tunnel. If your home connection uploads slower than the film's bitrate, it will stall at your friend's, however fast their Wi-Fi is.
- The TV still needs to be one that listens, a Chromecast or a TV that plays from the network. If not, a browser on any laptop or tablet in the room works too.
Ferry is an independent app, not affiliated with, endorsed or sponsored by Plex, Inc.
or Google LLC. Plex is a trademark of Plex, Inc. Chromecast is a trademark of Google
LLC.