xvzc / SpoofDPI

A simple and fast anti-censorship tool written in Go
Apache License 2.0
3.33k stars 242 forks source link

Lots of time-outs #72

Closed vsl-iil closed 2 weeks ago

vsl-iil commented 1 month ago

Describe the bug

Debug log shows time-outs of most of the connections, for example:

CONNECT connectivitycheck.gstatic.com:443 HTTP/1.1 Host: connectivitycheck.gstatic.com:443 Proxy-Connection: Keep-Alive User-Agent: Dalvik/2.1.0 (Linux; U; Android 10; CPH1931 Build/QKQ1.200209.002)

DEBU[2024-07-31T13:15:08+03:00] [DNS] resolved dns for connectivitycheck.gstatic.com: 173.194.222.94 DEBU[2024-07-31T13:15:08+03:00] [PROXY] Start HTTPS DEBU[2024-07-31T13:15:08+03:00] [HTTPS] New connection to the server connectivitycheck.gstatic.com 192.168.0.200:49372 DEBU[2024-07-31T13:15:08+03:00] [HTTPS] Sent 200 Connection Estabalished to 192.168.0.35:39264 DEBU[2024-07-31T13:15:08+03:00] [HTTPS] Client sent hello 517bytes DEBU[2024-07-31T13:15:08+03:00] [HTTPS] Writing chunked client hello to connectivitycheck.gstatic.com DEBU[2024-07-31T13:15:10+03:00] [HTTPS] Error reading from 192.168.0.35:39264 timed out DEBU[2024-07-31T13:15:10+03:00] [HTTPS] Closing client Connection.. 192.168.0.35:39264 DEBU[2024-07-31T13:15:10+03:00] [HTTPS] Error reading from 173.194.222.94:443 timed out DEBU[2024-07-31T13:15:10+03:00] [HTTPS] Closing server Connection.. connectivitycheck.gstatic.com 192.168.0.200:49372

Possibly related to #26? The proxy also does not seem to affect YouTube throttling.

Expected behavior

Little to no timeouts

Actual behavior

Many timeouts

How To Reproduce?

  1. Start SpoofDPI with parameters -addr 0.0.0.0 -port 8082 -debug (not sure how relevant are these)
  2. Connect from Android phone
  3. Wait for the logs

Client information

OS: Server: aarch64 GNU/Linux 6.1.31-1+ Client: Android 10

Version: spoog-dpi v0.0.0(dev) (sic!)

Additional context

xvzc commented 1 month ago

the logs saying lots of timed out are an expected behavior. the https request may have contained keep-alive header so the connection will be timed out after the period of time that's given as the command line argument. (default to 2000ms). I'm going to take a look what's wrong with youtube thing soon.

MahouShoujoMivutilde commented 1 month ago

For youtube you might want to give https://github.com/hufrea/byedpi/ a go.

SpoofDPI worked great for me until just about a few days ago, but then my ISP learned to reassemble Client Hello, and now only more complex byedpi's desync/fake methods work.

@xvzc You did great with all the improvements recently btw, sucks that my ISP improved its DPI too.

xvzc commented 1 month ago

@MahouShoujoMivutilde Thanks! I personnaly wanna implement the feature that can send fake client hello packet too, but because of the lack of knowledge in Golang and Network, I've been still figuring out how to do it.

Ledorub commented 2 weeks ago

@xvzc, is this issue still relevant? Or it can be closed?