Forums » Tutorial and setups »
Running via VPN
Added by Greg Spence about 6 years ago
My aim is to use my raspberry pi 3 as my "media gateway".
I currently have tvheadend set up perfectly, channels mapped EPG etc all working great feeding clients on my local network.
On my pi, i use transmission for downloading which I have managed to configure to use a VPN split tunnel per the guide:
https://www.htpcguides.com/configure-transmission-for-vpn-split-tunneling-ubuntu-16-04-debian-8/
I would like to have tvheadend also use this VPN tunnel so any of the IPTV streams I have set up are coming into my pi via the VPN. From my understanding of my setup when a service is run under the user vpn (which belongs to the group vpn) traffic comes through the tunnel. Is there a way I can export my settings and have tvheadend run under the user "vpn" instead of "hts"
Any help appreciated!
Replies (3)
RE: Running via VPN - Added by Joe User about 6 years ago
Unless your VPN is really exceptional, it will probably not work well for streaming. VPN's are first of all slow, and more importantly, have inconsistent bandwidth. While this is an acceptable degradation for privacy sake, it makes live streaming quite unreliable. It "may" be ok if used just for recording (if the timeout is high enough), but watching would be terrible.
Second issue is that changing to the vpn user would make all tvheadend clients also use the vpn, which makes things twice as bad. So you would have to setup a reverse proxy to avoid it.
Best way would be to use curl or wget with a pipe as the url for your iptv source. With each, you can set your source address to your vpn, which would then use the vpn to connect to the iptv source. Something like:
pipe:///usr/bin/wget -qO- --bind-address VPN_ADDRESS http://IPTV_SOURCE
where VPN_ADDRESS is the ip address of your vpn interface (tun0??)
RE: Running via VPN - Added by Greg Spence about 6 years ago
Thanks for your reply. Does that mean that I have the command pipe:///usr/bin/wget qO --bind-address tun0 under the "environment (pipe)" box under the mux settings?
RE: Running via VPN - Added by Joe User about 6 years ago
Greg Spence wrote:
Thanks for your reply. Does that mean that I have the command pipe:///usr/bin/wget
qO--bind-address tun0 under the "environment (pipe)" box under the mux settings?
No, it goes in "URL" in front of the url for your iptv source.
and for the --bind-address you need to use the actual ip address of your vpn network adapter. To find the address, you can run "ifconfig" or if that doesn't work try "ip address show" - both should list all your adapters and their addresses. The vpn probably will be tun0 or similar.