arvidn / libtorrent

an efficient feature complete C++ bittorrent implementation
http://libtorrent.org
Other
5.26k stars 996 forks source link

UDP trackers and SOCKS5 support #1373

Closed alex-druzhinin closed 6 years ago

alex-druzhinin commented 7 years ago

libtorrent can't connect to UDP trackers if SOCKS5 proxy used.

It calls tcp/accept and tcp/bind on the proxy. But when it try to send UDP packet to tracker - error operation_not_supported returned.

I can see the issue in master branch - in session_impl.cpp, method send_udp_packet_hostname. It want to use a socket from m_listen_sockets, but there are no sockets for UDP tracker. It should open a new UDP socket and use UDP ASSOCIATE, but instead returns error.

RC_1_1 also can't connect to UDP trackers, but looks like it's implemented in other way.

Is master branch stable enough to use it for a project? Or better we should stay on RC_1_1?