alexkirsz / dispatch

Combine internet connections, increase your download speed
Apache License 2.0
353 stars 28 forks source link

When an ethernet connection is active, the wifi connection stops working #26

Open Rosentti opened 10 months ago

Rosentti commented 10 months ago

With Ethernet+WiFi (wlp1s0 addresses in use for proxy):

curl -x socks5://127.0.0.1:1080 http://api.ipify.org
(hangs)

With WiFi only (wlp1s0 addresses in use for proxy):

curl -x socks5://127.0.0.1:1080 http://api.ipify.org
85.XX.XX.XX

With Ethernet+Wifi (eno1 addresses in use for proxy):

curl -x socks5://127.0.0.1:1080 http://api.ipify.org
84.XXX.XXX.XXX

Using socks4 with any configuration results in curl: (97) Recv failure: Connection reset by peer. Running on Arch Linux, have ethernet and wifi. Is this a kernel limitation or something wrong with rust's networking/this program?

Rosentti commented 10 months ago

Doesn't seem to be a limitation of the kernel:

curl --interface eno1 http://api.ipify.org
84.XXX.XXX.XXX
curl --interface wlp1s0 http://api.ipify.org
85.XX.XX.XX
Rosentti commented 10 months ago

cURL inhibits this behaviour too (only with specific ip, by interface name works as before):

curl --interface 192.168.0.106 http://api.ipify.org
84.XXX.XXX.XXX
curl --interface 192.168.172.224 http://api.ipify.org
(hangs)
Rosentti commented 10 months ago

Fixed myself. Will create PR soon.

Tom60chat commented 6 months ago

I wanted to use your solution because I thought I might have the same problem as you.

So I compiled your source and : image

It doesn't work on Windows because you're using a function that isn't implemented on Windows (check tokio TcpSocket doc), so I wouldn't recommend @alexkirsz to accept the PR #27 (You can use Conditional compilation to make it a Linux-only feature.)