krlvm / PowerTunnel

Powerful and extensible proxy server with anti-censorship functionality
GNU General Public License v3.0
1.17k stars 77 forks source link

VPN mode in desktop version? #123

Closed Alyaqdhans closed 1 year ago

Alyaqdhans commented 1 year ago

Is it possible to set it up like the android version so the traffic of all applications goes through it? because it is now working only for websites and not programs. image I mean there is VPN option in windows..

krlvm commented 1 year ago

It is enough to configure proxy server on Windows - it works with all programs. In fact, VPN mode is a crutch, needed only for Android (maybe also iOS, but I do not plan an iOS version), which sags a bit in performance compared to regular proxy mode.

Alyaqdhans commented 1 year ago

I have a game called Roblox that is blocked from our country, when I use PowerTunnel the website works but the game doesn't, any idea why? because in the android version it works perfectly. And is it possible for me to set up PowerTunnel with a network adapter? I think it will fix the problem. I really need this program to work with Roblox, I love the fact that it doesn't traffic your data on third-party servers which makes it super fast.

krlvm commented 1 year ago

If you are on Windows, GoodbyeDPI may better suit you in this case. Check the game itself for proxy settings, maybe you can configure it there.

Alyaqdhans commented 1 year ago

I used GoodbyeDPI but it doesn't work at all, not even the website of the game works, yours at least made the website work. I don't think I can do anything to make it work other than you adding a VPN feature, I would really appreciate you adding the feature, is it very complicated to add it?

krlvm commented 1 year ago

There are two problems here: firstly, for this I will have to write platform-specific code for Windows - VPN->Proxy tunnel ala tun2http, and secondly, I will have to nail something to Windows, which will hit cross-platform.

Check if you can specify a proxy server in your game settings.

Alyaqdhans commented 1 year ago

I can't specify a proxy server in Roblox and this is what my proxy windows settings look like when I turn it on: image

mhtvsSFrpHdE commented 1 year ago

The closest thing you(also I) can get is find a cheap SSTP VPN provider, then connect SSTP through PowerTunnel.
SSTP is a kind of VPN can wrap any type of traffic into HTTP,
and go through HTTP proxy: even they usually don't support Gaming UDP package.

The PowerTunnel server should run on another device,
otherwise, dead loop happen because PowerTunnel.exe's traffic also captured by SSTP.
It will connect itself to itself.

Server A: Gaming Server
Server B: SSTP VPN Provider close to Gaming Server in physics
LAN device C: PowerTunnel server
LAN device D: Gaming PC

D SSTP -> C -> B -> A

The Windows SSTP client will use system proxy setting to connect if existed.
The reason you wrap SSTP into PowerTunnel, is certainly your ISP is gonna to block SSTP connection for no reason.
But if you can't afford a VPN, you are out of luck.

In my opinion, PowerTunnel and anti dpi basically is another of
https://zh.wikipedia.org/zh-cn/%E8%A5%BF%E5%8E%A2%E8%AE%A1%E5%88%92
So get a VPN instead. It won't work as your imagination.

mhtvsSFrpHdE commented 1 year ago

However, if you have root on your Android, things will start to become interesting.

Use root to install Debian, download and compile SoftEther VPN Server,
therefore, you can run this little thing on Android,
and in theory, the VPN server's connection will capture by PowerTunnel Android VPN.

So you may get this:

Server A: Gaming Server
LAN device B: PowerTunnel Android, SoftEther VPN server
LAN device C: Gaming PC

C SoftEther VPN -> B -> A

Notice that VPN server and VPN client is located in same LAN, no third party provider involved.
I did similar things once, many years ago, that time I need to extend a VPN provider to PC,
but they only have Android client.

You may find other vpn server but running on Android to replace SoftEther,
so you don't have to root.

I do interest to try such thing again because it sounds really cool.
You can wait my result before root, because you will lose warranty, and it's no guaranteed to success.

Alyaqdhans commented 1 year ago

I found a really good VPN for just 3$ it is called Windscribe

mhtvsSFrpHdE commented 1 year ago

@AlyaqdhanZ Hi, I'm already successfully use my rooted Android Phone as a server,
redirect all traffic from PC to Android, then from Android to website.

For example, set upstream proxy on Android PowerTunnel,
use PC VPN client to connect the VPN server on Android,
then the PC is using the proxy too even proxy setting is empty.
DNS plugin is work, so I assume other plugin should just work too.

If you choose a non-root Linux solution like Termux, the solution is not stable,
because Android may kill background service. Which is the root solution won't be killed (Linux Deploy).

mhtvsSFrpHdE commented 1 year ago

@krlvm Anyone else also interested in this solution?
For example, assume PowerTunnel is HTTP proxy,
known as not support UDP package.
However, a VPN server running on Android can forward UDP package and finally be captured by PowerTunnel.

What will happen to this UDP package then? Will it be covered by LibertyTunnel plugin?

krlvm commented 1 year ago

PowerTunnel plugins, including LibertyTunnel, are just instructing the PowerTunnel proxy on how to handle requests and responses. If a packet is proxied via PowerTunnel proxy, it should be handled by its plugins by definition.

Not sure about UDP stuff, will check later.

mhtvsSFrpHdE commented 1 year ago

@AlyaqdhanZ @krlvm I have run one of my co-op online game.
Unfortunately, the game could check update, and show in game browser with game website,
but will not join the game, just hang at loading screen.
I assume this is because UDP packages is not being handled.

In the https://github.com/ValdikSS/GoodbyeDPI page,
there are full of TCP, HTTP, HTTPS words, but no description about UDP.
This is not supported, so go and get a VPN instead.

A exist feature request to UDP support: https://github.com/ValdikSS/GoodbyeDPI/issues/276