Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Traffic to Be Routed Through VPN #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

richardgetz
Copy link

We had discussed this some time ago but my beautifier wreaked havoc on the repository so I didn't want to open a PR. With the new version I started fresh and figured this may be worthwhile to others. The idea here is that the original port works as normal but the new input allows you to define a different external port that will be used for Plex. In practice, I route all of cabernet's traffic through a VPN prior to it connecting to various plugins and internally I need to use the port my VPN container uses for me to access. By default, I made the port number the same as normal so it would not affect users not using a VPN.

@rocky4546
Copy link
Contributor

I'll take a look

@stale
Copy link

stale bot commented Apr 24, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive associated with a stale issue label Apr 24, 2023
@rocky4546 rocky4546 added enhancement New feature or request and removed inactive associated with a stale issue labels Apr 24, 2023
@joelstitch
Copy link

Are you able to connected to Plex when running cabernet through a VPN?

@richardgetz
Copy link
Author

I use a docker image called gluetun which lets me route other docker containers through it using a vpn provider of my choosing. You can choose a port on gluetun to connect to as needed. My changes allowed me to achieve this as needed to be able to route my entire connection through a vpn to view some channels that require it. I need to update again as I have slightly diverged from the most recent updates. If there is interest I can update my PR and try again.

@joelstitch
Copy link

I run cabernet through a docker that runs through a VPN. My issue is that Plex sees the tuner and gets the epg data but won't play anything even though I'm able to play things through VLC.

@richardgetz
Copy link
Author

I'm not sure exactly what the issue is but I plan to update the vpn fork to the latest version today or later this week as I have some plugins that need updating as well. If you need help with your setup you can message me on discord (un: .r00tus3r) and I can try to assist.

@joelstitch
Copy link

I'm not sure exactly what the issue is but I plan to update the vpn fork to the latest version today or later this week as I have some plugins that need updating as well. If you need help with your setup you can message me on discord (un: .r00tus3r) and I can try to assist.

I appreciate it. I'll take sometime this today and tomorrow to try your setup, I'll shoot you a message when I do.

@malvinas2
Copy link

malvinas2 commented May 14, 2024

Sorry to hijack this thread: I use a docker image, which contains OpenVPN and privoxy. As mentioned by you, it lets me route traffic through it using a vpn provider.
Is it possible to extend your feature in a way, that several instances of pluto.tv are running, each of them accessing the web through different ports resp. different VPNs?

@richardgetz
Copy link
Author

Sorry to hijack this thread: I use a docker image, which contains OpenVPN and privoxy. As mentioned by you, it lets me route traffic through it using a vpn provider. Is it possible to extend your feature in a way, that several instances of pluto.tv are running, each of them accessing the web through different ports resp. different VPNs?

I feel like that is more dependent upon what container service you use to route to each VPN. I use gluetun, I'm not sure if it let's you use multiple VPNs at the same time. Nothing is stopping you from having a separate docker container for each though.

@malvinas2
Copy link

Nothing is stopping you from having a separate docker container for each though.

I have got separate docker container for each vpn connection. But how do I tell cabernet/pluto.tv to route Internet traffic through a specific VPN container? I have been searching for a parameter like --http-proxy 127.0.0.1:9973 (or whatever port the actual VPN uses).

@richardgetz
Copy link
Author

Nothing is stopping you from having a separate docker container for each though.

I have got separate docker container for each vpn connection. But how do I tell cabernet/pluto.tv to route Internet traffic through a specific VPN container? I have been searching for a parameter like --http-proxy 127.0.0.1:9973 (or whatever port the actual VPN uses).

Ahh I see what you mean. The easiest option is one Cabernet and VPN container pair per route you want. What I setup won't natively do what you're trying to achieve. You'd have to fork and make some modifications if you wanted it all in one. It's been awhile since I've looked at the code, I don't think that would be easy to achieve.

@richardgetz
Copy link
Author

Nothing is stopping you from having a separate docker container for each though.

I have got separate docker container for each vpn connection. But how do I tell cabernet/pluto.tv to route Internet traffic through a specific VPN container? I have been searching for a parameter like --http-proxy 127.0.0.1:9973 (or whatever port the actual VPN uses).

Ahh I see what you mean. The easiest option is one Cabernet and VPN container pair per route you want. What I setup won't natively do what you're trying to achieve. You'd have to fork and make some modifications if you wanted it all in one. It's been awhile since I've looked at the code, I don't think that would be easy to achieve.

I guess the big question here is why are you trying to do this? It doesn't seem like the best setup tbh.

@malvinas2
Copy link

malvinas2 commented May 15, 2024

Ahh I see what you mean. The easiest option is one Cabernet and VPN container pair per route you want.

Well, I could run Cabernet and VPN in one and the same container, running several container for different regions. But I would like to avoid this setup, as I would have to modify my self-build image every time something changes within cabernet.

I guess the big question here is why are you trying to do this?

I would like to receive pluto.tv from different countries; in our special case I want to watch german-speaking channels, whereas my wife wants to watch the spanish-speaking ones. The whole thing ideally in conjunction with TvHeadend. If I were only interested in the program offered in a specific region, it would be easier to use the pvr module for pluto integrated into Kodi.

@rocky4546
Copy link
Contributor

Per the requests python library, you can add a proxy with the following environment variables.
$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"
$ export ALL_PROXY="socks5://10.10.1.10:3434"
https://requests.readthedocs.io/en/latest/user/advanced/#proxies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants