c4dt / lightarti-rest

Arti-wrapper to use REST over Tor
MIT License
5 stars 3 forks source link

Arti request takes 4 minutes #25

Closed cgrigis closed 3 years ago

cgrigis commented 3 years ago

When running the GET at google.ch with my Android test app, it looks like the request takes ~4 minutes:

(...)
2021-06-18 15:35:53.041 4371-4371/org.c4dt.myapplication D/ArtiLib: rustls::client::hs: ALPN protocol is None
2021-06-18 15:35:53.318 4371-4371/org.c4dt.myapplication D/ArtiLib: rustls::client::tls13: Ticket saved
2021-06-18 15:35:53.318 4371-4371/org.c4dt.myapplication D/ArtiLib: rustls::client::tls13: Ticket saved
2021-06-18 15:39:53.369 4371-7628/org.c4dt.myapplication D/ArtiLib: tor_proto::circuit::reactor: Circ 0.0: Circuit reactor stopped: Ok(())
2021-06-18 15:39:53.370 4371-7628/org.c4dt.myapplication D/ArtiLib: tor_proto::channel::reactor: Chan 0: Reactor stopped: Ok(())
2021-06-18 15:39:53.371 4371-4371/org.c4dt.myapplication D/ArtiApp: Response: Result is: Response { status: 301, version: HTTP/1.1, headers: {"location": "https://www.google.ch/", "content-type": "text/html; charset=UTF-8", "date": "Fri, 18 Jun 2021 13:35:56 GMT", "expires": "Fri, 18 Jun 2021 13:35:56 
(...)

this delay appears to be excessive.

tharvik commented 3 years ago

Hum, there is smth weird with the two tests locally having such a difference in runtime, I'll look into it.

tharvik commented 3 years ago

So, the request in client.test_get is by default versionned with HTTP_11 but the connection isn't closed on our end, so the request only works after a timeout. Hardsetting it to version HTTP_10 makes it works fast (~10s). I'm trying to write a patch but I find I got banned from the tor network (Received an End cell with reason CONNRESET nearly each time)

ineiti commented 3 years ago

but I find I got banned from the tor network (Received an End cell with reason CONNRESET nearly each time)

Hmm - I hope we're not doing something wrong here, which will ban all devices using this library, too!

@wouterl - @laurent-girod - do you have any idea how to check if @tharvik is banned, and if so, why, and most importantly, how to avoid it?

wouterl commented 3 years ago

That is a little bit weird. Can you look in the logs? Probably it still succeeds in building the circuit? Another good idea while doing massive testing: at least connect to a (HTTP) server that we own.