mirror of
https://github.com/snail007/goproxy.git
synced 2026-04-27 00:15:51 +03:00
[GH-ISSUE #507] Goproxy on Linux does not pick up application-based split tunneling from VPN #409
Labels
No labels
TODO
bug
duplicate
enhancement
good first issue
help wanted
helpful
invalid
need-confirm
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/goproxy#409
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JubilantJerry on GitHub (Oct 26, 2022).
Original GitHub issue: https://github.com/snail007/goproxy/issues/507
When I use Astrill VPN and make it only tunnel traffic from the
proxybinary using the "Tunnel only these apps" feature, Goproxy still does not use the VPN tunnel.It doesn't look like a problem with Astrill, since other SOCKS5 server applications I've tested (such as dante-server and https://github.com/ssrlive/s5proxy) all correctly start using the VPN tunnel when Astrill is set up like this. Browsers also start using the VPN if they are in the "Tunnel only these apps" list. The only application I've discovered to date that does not pick up the appropriate network settings is Goproxy. I'm pretty sure other VPN applications with application-based split tunneling will reproduce the same problem, but I don't have other VPN services to test with.
Expected Behavior
When "Tunnel only these apps" for a VPN client includes the
proxyprocess, Goproxy should start using the VPN tunnel for all network traffic, even if the VPN is started after theproxyprocess.Current Behavior
proxydirectly accesses the network interface (Wi-Fi in my case) without using the tunnel. Clients connected to the Goproxy server behave as if none of their traffic is tunneled.Possible Reason
I am guessing that application-based split tunneling works by changing the routing tables to make the highest priority default gateway use the tunnel interface (usually tun0). Then the tunnel re-routes the packets to one of two paths depending on which application made the request. This could only mean that Goproxy is accessing the network stack in an uncommon way that somehow causes it to bypass the VPN tunnel gateway.
This is what I saw with checking my routing tables:
If I run
sudo find /proc/* -type f | grep dev_snmp6 | grep tun0I find all sorts of application PID's, including ones that aren't supposed to use VPN, meaning that everything is supposed to be tunneled. But I don't see the Goproxy PID (on any network interface for that matter). I don't see any child processes spawned by Goproxy, so all I can say is that though I don't understand how Goproxy uses the network stack it looks like some non-standard practice is used.Steps to Reproduce
Pretty sure the same applies for any VPN provider, here's how it happens for me:
proxybinary from GoproxyproxyContext (Environment)
./proxy @config.txtconfig.txtcontains:@JubilantJerry commented on GitHub (Oct 26, 2022):
Interestingly, the same problem happens for Gost, so it's not just Goproxy:
https://github.com/ginuerzh/gost/issues/897
https://github.com/go-gost/gost/issues/121
Both use Go, so perhaps it is a problem related to a Go library?