MatsuriDayo / nekoray

Qt based cross-platform GUI proxy configuration manager (backend: sing-box)
https://matsuridayo.github.io/
GNU General Public License v3.0
11.3k stars 1.11k forks source link

[Ubuntu] Browsers like Chrome and Firefox not take effect with VPN mode on #268

Closed reza00farjam closed 1 week ago

reza00farjam commented 1 year ago

When I try to use ssh tunnel as VPN in Ubuntu 22.04.1 LTS, every traffic goes through remote server except browsers traffic. Tried reproduce in Windows 10 and it worked fine.

How to reproduce

  1. ssh to the remote server via ssh -D <local_port> root@<remote_ip> -p <ssh_port>
  2. set up a SOCKS 5 server in nekoray with host set to 127.0.0.1 and port <local_port>
  3. start the server
  4. turn on VPN mode
arm64v8a commented 1 year ago

Log

reza00farjam commented 1 year ago

Log

Log on openning youtube.com in Chrome after steps 1 to 4:

>>>>>>>> Starting profile [Socks] 127.0.0.1:12345
>>>>>>>> Profile is insecure: This profile is cleartext, don't use it if the server is not in your local network.
[2023-01-05 11:26:35] [Warning] V2Ray 5.2.0 started
[2023-01-05 11:26:44] [Warning] [181084343] app/dispatcher: default route for [tcp:216.239.38.120:443] tcp:www.google.com:443
[2023-01-05 11:26:44] tcp:127.0.0.1:59910 accepted [tcp:216.239.38.120:443] tcp:www.google.com:443 [socks-in -> proxy]
[2023-01-05 11:26:44] [Warning] [1415074935] app/dispatcher: default route for [tcp:140.82.121.6:443] tcp:api.github.com:443
[2023-01-05 11:26:44] tcp:127.0.0.1:59920 accepted [tcp:140.82.121.6:443] tcp:api.github.com:443 [socks-in -> proxy]
[2023-01-05 11:26:44] tcp:127.0.0.1:59936 accepted [tcp:172.253.120.188:5228] tcp:mtalk.google.com:5228 [socks-in -> proxy]
[2023-01-05 11:26:44] [Warning] [3631561017] app/dispatcher: default route for [tcp:172.253.120.188:5228] tcp:mtalk.google.com:5228
[2023-01-05 11:26:46] tcp:127.0.0.1:59940 accepted [tcp:142.250.186.106:443] tcp:optimizationguide-pa.googleapis.com:443 [socks-in -> proxy]
[2023-01-05 11:26:46] [Warning] [2852005964] app/dispatcher: default route for [tcp:142.250.186.106:443] tcp:optimizationguide-pa.googleapis.com:443
[2023-01-05 11:26:46] tcp:127.0.0.1:59946 accepted [tcp:10.10.34.36:443] tcp:youtube.com:443 [socks-in -> proxy]
[2023-01-05 11:26:46] [Warning] [326185287] app/dispatcher: default route for [tcp:10.10.34.36:443] tcp:youtube.com:443
[2023-01-05 11:27:16] [Warning] [1840294914] app/dispatcher: default route for [tcp:172.217.23.99:80] tcp:www.gstatic.com:80
[2023-01-05 11:27:16] tcp:127.0.0.1:38458 accepted [tcp:172.217.23.99:80] tcp:www.gstatic.com:80 [socks-in -> proxy]
[2023-01-05 11:27:17] tcp:127.0.0.1:38474 accepted [tcp:10.10.34.36:443] tcp:youtube.com:443 [socks-in -> proxy]
[2023-01-05 11:27:17] [Warning] [1733106860] app/dispatcher: default route for [tcp:10.10.34.36:443] tcp:youtube.com:443
[2023-01-05 11:27:27] [Warning] [2821142674] app/dispatcher: default route for [tcp:142.250.186.174:443] tcp:clients4.google.com:443
[2023-01-05 11:27:27] tcp:127.0.0.1:33062 accepted [tcp:142.250.186.174:443] tcp:clients4.google.com:443 [socks-in -> proxy]
[2023-01-05 11:27:40] tcp:127.0.0.1:49176 accepted [tcp:10.10.34.36:443] tcp:deploy.windscribe.com:443 [socks-in -> proxy]
[2023-01-05 11:27:40] [Warning] [11023513] app/dispatcher: default route for [tcp:10.10.34.36:443] tcp:deploy.windscribe.com:443
[2023-01-05 11:27:46] [Warning] [326185287] app/proxyman/outbound: failed to process outbound traffic > proxy/socks: failed to establish connection to server > read tcp 127.0.0.1:47134->127.0.0.1:12345: i/o timeout
>>>>>>>> Stopping profile [Socks] 127.0.0.1:12345
[2023-01-05 11:27:51] [Warning] [181084343] app/proxyman/outbound: failed to process outbound traffic > proxy/socks: connection ends > read tcp 127.0.0.1:47084->127.0.0.1:12345: use of closed network connection
[2023-01-05 11:27:51] [Warning] [1733106860] app/proxyman/outbound: failed to process outbound traffic > proxy/socks: failed to establish connection to server > read tcp 127.0.0.1:39424->127.0.0.1:12345: use of closed network connection
[2023-01-05 11:27:51] [Warning] [11023513] app/proxyman/outbound: failed to process outbound traffic > proxy/socks: failed to establish connection to server > read tcp 127.0.0.1:35580->127.0.0.1:12345: use of closed network connection
hoseinnikkhah commented 1 year ago

I noticed on my Debian machine that VPN mode does not work at all but proxy mode works really well, It fulfills my needs but public IP is exposed. I tested my browser with webRTC, don't know why but after changing DNS from local provider to cloudflare it was fine.

hoseinnikkhah commented 1 year ago

Try testing this to fix your browser, go to routing setting and change remote DNS to either 8.8.8.8 or 1.1.1.1 The default is https://8.8.8.8/dns-query Do not enter DNS with https and use the app in system proxy option checked. VPN mode still does not work but this will hide your browser IP address

reza00farjam commented 1 year ago

Thank you @hoseinnikkhah for the workaround. But unfortunately even after applying the steps you mentioned, still browsers not working and the problem stands still.

arm64v8a commented 1 year ago

accepted [tcp:10.10.34.36:443] tcp:youtube.com:443 [socks-in -> proxy]

It seems to be a DNS leak problem that did not appear in the test environment.

DonMakav3li commented 1 year ago

I'm having a similar problem on Windows 11, some websites load fine on my browser but some like youtube open but videos and images don't load.

Farzinnn commented 1 year ago

in ubuntu 22.04 vpn mode doesnt work on browsers like chrome or firefox.but apps like telegram is ok. and proxy mode work in browser but app like telegram doesnt work with proxy mode.

neomn commented 1 year ago

in fedora , telegram client works with vpn mode and browsers works with proxy mode, don't know why

AmirHosseinKarimi commented 1 year ago

Are you sure VPN Mode is enabled? The checkbox in the app is checked?

reza00farjam commented 1 year ago

Are you sure VPN Mode is enabled? The checkbox in the app is checked?

Yes, why else should I open an issue for that!

mrafee113 commented 1 year ago

I'm haing the same problem as @Farzinnn. Ubuntu 22.10. nekoray-2.11-2023-01-13-linux64. also tried it with 2.13. no luck. I have a manual ipv4 dns ip list: 8.8.8.8, 8.8.4.4, 1.1.1.1, 1.0.0.1, 208.67.222.222, 208.67.220.220, 45.33.97.5, 37.235.1.177, 37.156.145.21, 91.99.101.12, 194.225.62.80 It's notable that I had previously installed v2ray along with v2raya, but deleted it along with their files (as much as I could find) a couple minutes ago. Still, nekoray is malfunctioning. I tried removing my dns list, didn't work. I tried doing the routing tweak that @hoseinnikkhah suggested, didn't affect the malfunction. I don't have an application besides my chrome browser per se. But some websites in chrome open and some don't. Websites that were not objected through my country's ban open with no problem. Among the ones that that have problem loading, there seems to be banned and unbanned websites. Here's some examples.

The ones that don't open: youtube.com twitter.com instagram.com open.spotify.com webz.telegram.org web.whatsapp.com toggl.com letterboxd.com yts.mx 1337.to quora.com pdfdrive.com sci-hub.se kaggle.com downloadha.com

The ones that do: thepiratebay10.org watchsomuch.to gen.lib.rus.ec play.google.com notion.so linkedin.com reddit.com tvtime.com blinklist.com podcasts.google.com p30download.ir

I cannot find a strict pattern here. Any suggestions? For further information, here's a log. ctxt.io. It only lasts for 24 hours. If curious, tell me to refresh it; it's 400 lines.

mrafee113 commented 1 year ago

I solved my problem by using v2ray-core and switchy-omega instead.

iamjavadabedi commented 1 year ago

I had this problem with my browser in Linux Mint, too. I changed Network proxy method from None to Manual. Now I just enable VPN Mode and use NekoRay.