mpetazzoni / ttorrent

BitTorrent Java library with tracker and download client
http://mpetazzoni.github.com/ttorrent/
Apache License 2.0
1.38k stars 502 forks source link

Fix connection http #150

Open bracouda opened 8 years ago

bracouda commented 8 years ago

At the beginning

2015-09-26 00:00:30 WARN  Announce:226 - Error reading tracker response!
2015-09-26 00:00:31 INFO  Client:451 - SHARING 0/1410 pieces (0,00%) [0/0] with 0/0 peers at 0,00/0,00 kB/s.
2015-09-26 00:00:34 INFO  Client:451 - SHARING 0/1410 pieces (0,00%) [0/0] with 0/0 peers at 0,00/0,00 kB/s.
2015-09-26 00:00:35 INFO  HTTPTrackerClient:80 - Announcing STARTED to tracker with 0U/0D/369412096L bytes...
2015-09-26 00:00:35 WARN  Announce:226 - Error reading tracker response!

After investigation, I found an error in response for Http request (403) But with adding user agent in header of request. Http request can go through tracker's protection.

By the way, the protection is cloudflare.

mpetazzoni commented 8 years ago

Any particular reason you're faking a browser user agent instead of setting something more specific, like User-Agent: ttorrent(<version>) ? If the tracker is only checking for the presence of a user agent, it would work fine all the same, but actually be useful.