-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Selective ("smart") proxying #887
Comments
Glad to see this. A few notes:
It is. For example, we almost instantly got user complaints when we accidentally got foreign IPs for WeChat domains in our VPN client.
Is it a different issue from above?
v2ray solved this problem by introducing an internal DNS and a GeoSite database: https://www.v2ray.com/en/configuration/dns.html . Does Outline use tun2socks? If so Outline should be able to see domains, no?
Do people from other places have the same feature request? I think you can add it country by country.
Some apps (e.g Shadowsocks for Android) used to have this feature, but AFAIK it's not popular anymore. |
@felixding Would this heuristic work?
Do the wechat domains end with the country code TLD? |
On bad geolocation, sometimes the IP -> country map may be wrong, so you may end up proxying something you don't need, or not proxy something you need. But perhaps it's good enough in most countries. SOCKS proxies see domain names, but Outline sees IP packets. Outline uses tun2socks, but that gives us connections with IP:port, not domains. Does v2ray intercept all system traffic or does it work as a system proxy? |
Both are supported and widely used. When intercepting all traffic, a sniffing mechanism can be used to detect the target domain name from HTTP/HTTPS requests. A new FakeDNS implementation is coming soon (v2fly/v2ray-core#406). |
There are corner cases for the domestic bypass. For example, you may be in a network in Canada that blocks psiphon.ca, even though the government doesn't block it. In practice I don't think that will be a big issue, and we are really mainly focused on state-level blocking anyway. The user still has the option to fallback to proxying all traffic. |
Proxy all traffic by default, except domains and IPs in the list. BTW, V2Ray(now maintained by V2Fly team) gathers popular domains classified by organization/company in repo: https://github.com/v2fly/domain-list-community |
Interesting idea. It may work for some websites but certainly not all, as most popular websites in China use
No. WeChat probably have some
Should be fine I think.
v2ray is a proxy just like Shadowsocks. It doesn't have tun so it doesn't intercept all system traffic. Unless I missed something but tun2socks should give you domains. Our implementation is like:
|
V2Fly doesn't get the domains from tun2socks. They use a fake DNS to map fake IPs to the original domains. |
No. V2ray does not have Fake DNS yet. There is a PR but not merged: v2fly/v2ray-core#406 The way v2ray gets domains is sniffing which "extracts domain names from TLS and HTTP traffic" (https://guide.v2fly.org/en_US/app/transparent_proxy.html#notes). |
regarding DNS question, I think we assume all domestic IPs don't need to be proxied. also, Alexa Top Sites list for each country can be useful. if it's on the top sites, it means it is not blocked and no reason for proxy. |
It is necessary to set up a list of ips that require a proxy or a country that does not require a proxy. |
I don't think client side need to consider more about ip/domain or location in a country if block or not. Just provide an interface to turn proxy on/off and retrieve a rule edit manually or remotely. Every developer in different country would think more to the rules. Make the client more extensible. @fortuna |
It would be nice to be able to manually edit the allow/deny ip list. |
Those in the list will go to proxy these whitelisted domain names or IP addresses, and the rest will not choose to proxy. Select global proxy traffic when users don't need PAC |
What Clash Proxy did with Enhanced Mode is probably the best. It does use a VPN mode on entire system but internally don't send traffic through proxy if it is whitelisted. PAC/Proxy mode might not be supported on all apps |
There's a report that, when a user in China uses a proxy to access a target in China, the GFW may be able to correlate the incoming and outgoing traffic in the proxy, and determine it's a proxy: net4people/bbs#129 (comment) Bypassing domestic traffic would prevent that. |
@fortuna as a user, I would very much appreciate if split tunnel option can be implemented soon. Switching on/off the VPN all day is inconvenient as I need certain traffic through chinese network routing (e.g. video calls) while googling stuff on my browser. Would hate to have to move away from Outline due to the lack of split tunnelling option. |
Please factor in interests in this issue too: #602 My reply there:
|
@kayx23 we have not been able to prioritize this due to technical challenges and lack of headcount. More recently we've been focused on working around blocking in Iran and China. Since then we introduced dynamic keys and prefix camouflaging. We are now looking into making our network stack independent of the protocol, so we can use different protocols, and compose them in different ways, so we can have more agility in the strategies. We also want to release an SDK to let people build tools more easily, since we don't usually have the capacity to build many tools people ask. We do have some exploratory code: https://github.com/Jigsaw-Code/outline-client/tree/bemasc-split-tunnel. But we won't be able to get back to it anytime soon. |
I see. Thank you for the information : ) |
Hi! Is it hard to implement a feature that only certain websites are proxied? So I can make a silly txt file in the root folder with a website on each row so that Outline only reroutes when accessing those websites? |
Yeah unfortunately each platform is different so supporting all five at once (ios, android, linux, windows, macos) is challenging. We are working towards it, however! |
Smart proxying is a really good idea and the comments in this thread outlines creative ways to do this. This feature will increase general uptake of Outline by the man in the street as the current server doesn't handle non-sensitive traffic like video etc. in a cost effective manner. This blocks users who cannot afford to implement privacy for non-sensitive data. What is the status of activity now (@daniellacosse @fortuna )? I see the branch referenced split tunnelling has been deleted. https://github.com/Jigsaw-Code/outline-client/tree/bemasc-split-tunnel Maybe start with a bazar approach and just do a text file URL whitelist with very basic DNS translation. This could cover 80% of the Youtube/Tiktok/Reddit use cases and put Outline in reach for people who cannot use it now due to pricing issues. This whitlist can be created locally on the client and/or pushed from the service for organisational policies. I have some time to help with such a branch if it could help. |
@daniellacosse Is there any updates? This topic exists since 2020 |
In my country, websites related to government agencies in most cases block all connections not from the IP of my country. These include tax services, traffic police, utility bill payment services, medical institution websites, etc. For all of them, VPN currently has to be disabled. |
This functionality would be extremely useful if implemented. |
Bump this, I've been having issues with comfortable use of nekoray for accessing the outside world, so a better alternative would be very welcome |
This issue is to track selective proxying (also known as "smart routing") on the Outline clients and gather feedback and input from the community.
Why?
There's large demand for not proxying what is not blocked. Some reasons:
Approaches
Bypass Domestic traffic
Intercept all DNS traffic:
On TCP or UDP connection:
Difficulties:
Examples
Domain or IP list
The customer could specify domains or IPs to force or bypass proxying.
To handle domains, we need to convert them to IPs. To do so, the client can intercept all DNS requests. Then depending on the approach:
Note that IPs may affect more than one domain.
Difficulties:
standard for mapping IPv6 to IPv4, but we would map domains instead.
Examples
Application list
We can provide a way for the user to force proxying or force bypass for specific applications on a device (#933).
That's doable on Android (we do it for Intra), and it seems we can use network namespaces (see also ip-netns) on Linux.
Difficulties:
Detect what's blocked
Outline could connect directly by default, and only proxy in case of blocking.
Difficulties
Examples:
Thanks @alalamav for doing a lot of this research.
The text was updated successfully, but these errors were encountered: