2013-06-12 09:57:13 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright (c) 2013, Arvid Norberg
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions
|
|
|
|
are met:
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
* Redistributions in binary form must reproduce the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer in
|
|
|
|
the documentation and/or other materials provided with the distribution.
|
|
|
|
* Neither the name of the author nor the names of its
|
|
|
|
contributors may be used to endorse or promote products derived
|
|
|
|
from this software without specific prior written permission.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "test.hpp"
|
|
|
|
#include "setup_transfer.hpp"
|
2013-06-12 19:03:56 +02:00
|
|
|
#include "dht_server.hpp"
|
2013-06-13 08:32:13 +02:00
|
|
|
#include "peer_server.hpp"
|
2014-02-23 02:32:55 +01:00
|
|
|
#include "udp_tracker.hpp"
|
2015-04-24 05:48:08 +02:00
|
|
|
#include "test_utils.hpp"
|
2016-08-21 18:15:19 +02:00
|
|
|
#include "settings.hpp"
|
2015-04-24 05:48:08 +02:00
|
|
|
|
2013-06-12 09:57:13 +02:00
|
|
|
#include "libtorrent/alert.hpp"
|
2015-01-15 04:28:24 +01:00
|
|
|
#include "libtorrent/random.hpp"
|
2013-06-12 09:57:13 +02:00
|
|
|
#include "libtorrent/alert_types.hpp"
|
2015-09-18 06:23:45 +02:00
|
|
|
#include "libtorrent/torrent_info.hpp"
|
2017-04-11 06:52:46 +02:00
|
|
|
#include "libtorrent/aux_/path.hpp"
|
2018-07-04 14:49:51 +02:00
|
|
|
#include "libtorrent/flags.hpp"
|
2013-06-12 09:57:13 +02:00
|
|
|
|
|
|
|
#include <fstream>
|
|
|
|
|
2017-04-12 20:05:53 +02:00
|
|
|
using namespace lt;
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-01-23 20:56:03 +01:00
|
|
|
namespace {
|
|
|
|
|
2013-06-12 09:57:13 +02:00
|
|
|
char const* proxy_name[] = {
|
|
|
|
"none",
|
|
|
|
"socks4",
|
|
|
|
"socks5",
|
|
|
|
"socks5_pw",
|
|
|
|
"http",
|
|
|
|
"http_pw",
|
|
|
|
"i2p_proxy"
|
|
|
|
};
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
using flags_t = flags::bitfield_flag<std::uint32_t, struct test_proxy_tag>;
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
constexpr flags_t expect_http_connection = 1_bit;
|
|
|
|
constexpr flags_t expect_udp_connection = 2_bit;
|
|
|
|
//constexpr flags_t expect_http_reject = 3_bit;
|
|
|
|
//constexpr flags_t expect_udp_reject = 4_bit;
|
|
|
|
constexpr flags_t expect_dht_msg = 5_bit;
|
|
|
|
constexpr flags_t expect_peer_connection = 6_bit;
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
constexpr flags_t dont_proxy_peers = 10_bit;
|
|
|
|
constexpr flags_t dont_proxy_trackers = 11_bit;
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-07-24 08:18:48 +02:00
|
|
|
session_proxy test_proxy(settings_pack::proxy_type_t proxy_type, flags_t flags)
|
2013-06-12 09:57:13 +02:00
|
|
|
{
|
2013-09-01 02:11:59 +02:00
|
|
|
#ifdef TORRENT_DISABLE_DHT
|
|
|
|
// if DHT is disabled, we won't get any requests to it
|
|
|
|
flags &= ~expect_dht_msg;
|
|
|
|
#endif
|
2018-07-04 14:49:51 +02:00
|
|
|
std::printf("\n=== TEST == proxy: %s \n\n", proxy_name[proxy_type]);
|
2017-12-02 19:33:56 +01:00
|
|
|
int const http_port = start_web_server();
|
|
|
|
int const udp_port = start_udp_tracker();
|
|
|
|
int const dht_port = start_dht();
|
|
|
|
int const peer_port = start_peer();
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2017-12-02 19:33:56 +01:00
|
|
|
int const prev_udp_announces = num_udp_announces();
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-03-30 12:50:31 +02:00
|
|
|
auto const alert_mask = ~(
|
|
|
|
alert::performance_warning
|
2018-04-26 09:01:14 +02:00
|
|
|
#if TORRENT_ABI_VERSION == 1
|
2018-03-30 12:50:31 +02:00
|
|
|
| alert::progress_notification
|
|
|
|
#endif
|
|
|
|
| alert::stats_notification);
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2016-08-21 18:15:19 +02:00
|
|
|
settings_pack sett = settings();
|
2014-07-06 21:18:00 +02:00
|
|
|
sett.set_int(settings_pack::stop_tracker_timeout, 2);
|
|
|
|
sett.set_int(settings_pack::tracker_completion_timeout, 2);
|
|
|
|
sett.set_int(settings_pack::tracker_receive_timeout, 2);
|
|
|
|
sett.set_bool(settings_pack::announce_to_all_trackers, true);
|
|
|
|
sett.set_bool(settings_pack::announce_to_all_tiers, true);
|
|
|
|
sett.set_int(settings_pack::alert_mask, alert_mask);
|
2014-08-01 07:44:48 +02:00
|
|
|
sett.set_bool(settings_pack::enable_upnp, false);
|
|
|
|
sett.set_bool(settings_pack::enable_natpmp, false);
|
2015-06-15 04:05:27 +02:00
|
|
|
sett.set_bool(settings_pack::enable_lsd, false);
|
2015-08-02 01:55:28 +02:00
|
|
|
sett.set_bool(settings_pack::enable_dht, true);
|
2014-07-06 21:18:00 +02:00
|
|
|
|
|
|
|
// since multiple sessions may exist simultaneously (because of the
|
|
|
|
// pipelining of the tests) they actually need to use different ports
|
2018-01-28 00:56:21 +01:00
|
|
|
static int listen_port = 10000 + int(lt::random(50000));
|
2014-07-06 21:18:00 +02:00
|
|
|
char iface[200];
|
2016-05-17 15:24:06 +02:00
|
|
|
std::snprintf(iface, sizeof(iface), "127.0.0.1:%d", listen_port);
|
2017-04-12 20:05:53 +02:00
|
|
|
listen_port += lt::random(10) + 1;
|
2014-07-06 21:18:00 +02:00
|
|
|
sett.set_str(settings_pack::listen_interfaces, iface);
|
2013-06-13 08:32:13 +02:00
|
|
|
|
|
|
|
// if we don't do this, the peer connection test
|
|
|
|
// will be delayed by several seconds, by first
|
|
|
|
// trying uTP
|
2014-07-06 21:18:00 +02:00
|
|
|
sett.set_bool(settings_pack::enable_outgoing_utp, false);
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2013-10-20 23:08:59 +02:00
|
|
|
// in non-anonymous mode we circumvent/ignore the proxy if it fails
|
|
|
|
// wheras in anonymous mode, we just fail
|
2014-07-06 21:18:00 +02:00
|
|
|
sett.set_str(settings_pack::proxy_hostname, "non-existing.com");
|
2017-12-02 19:33:56 +01:00
|
|
|
sett.set_int(settings_pack::proxy_type, proxy_type);
|
2018-07-04 14:49:51 +02:00
|
|
|
sett.set_bool(settings_pack::proxy_peer_connections, !(flags & dont_proxy_peers));
|
|
|
|
sett.set_bool(settings_pack::proxy_tracker_connections, !(flags & dont_proxy_trackers));
|
2014-07-06 21:18:00 +02:00
|
|
|
sett.set_int(settings_pack::proxy_port, 4444);
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
std::unique_ptr<lt::session> s(new lt::session(sett));
|
2013-06-12 19:03:56 +02:00
|
|
|
|
2013-06-12 09:57:13 +02:00
|
|
|
error_code ec;
|
2014-03-11 08:12:49 +01:00
|
|
|
remove_all("tmp1_privacy", ec);
|
2013-06-12 09:57:13 +02:00
|
|
|
create_directory("tmp1_privacy", ec);
|
|
|
|
std::ofstream file(combine_path("tmp1_privacy", "temporary").c_str());
|
2016-08-17 23:26:35 +02:00
|
|
|
std::shared_ptr<torrent_info> t = ::create_torrent(&file, "temporary", 16 * 1024, 13, false);
|
2013-06-12 09:57:13 +02:00
|
|
|
file.close();
|
|
|
|
|
|
|
|
char http_tracker_url[200];
|
2016-11-12 19:50:49 +01:00
|
|
|
std::snprintf(http_tracker_url, sizeof(http_tracker_url)
|
|
|
|
, "http://127.0.0.1:%d/announce", http_port);
|
2013-06-12 09:57:13 +02:00
|
|
|
t->add_tracker(http_tracker_url, 0);
|
2018-07-04 14:49:51 +02:00
|
|
|
std::printf("http tracker: %s\n", http_tracker_url);
|
2013-06-12 09:57:13 +02:00
|
|
|
|
|
|
|
char udp_tracker_url[200];
|
2016-11-12 19:50:49 +01:00
|
|
|
std::snprintf(udp_tracker_url, sizeof(udp_tracker_url)
|
|
|
|
, "udp://127.0.0.1:%d/announce", udp_port);
|
2013-06-12 09:57:13 +02:00
|
|
|
t->add_tracker(udp_tracker_url, 1);
|
2018-07-04 14:49:51 +02:00
|
|
|
std::printf("udp tracker: %s\n", udp_tracker_url);
|
2013-06-12 09:57:13 +02:00
|
|
|
|
|
|
|
add_torrent_params addp;
|
2017-07-09 16:32:01 +02:00
|
|
|
addp.flags &= ~torrent_flags::paused;
|
|
|
|
addp.flags &= ~torrent_flags::auto_managed;
|
2014-03-11 08:12:49 +01:00
|
|
|
|
|
|
|
// we don't want to waste time checking the torrent, just go straight into
|
|
|
|
// seeding it, announcing to trackers and connecting to peers
|
2017-07-09 16:32:01 +02:00
|
|
|
addp.flags |= torrent_flags::seed_mode;
|
2014-03-11 08:12:49 +01:00
|
|
|
|
2013-06-12 09:57:13 +02:00
|
|
|
addp.ti = t;
|
|
|
|
addp.save_path = "tmp1_privacy";
|
2013-06-12 19:03:56 +02:00
|
|
|
addp.dht_nodes.push_back(std::pair<std::string, int>("127.0.0.1", dht_port));
|
2013-06-12 09:57:13 +02:00
|
|
|
torrent_handle h = s->add_torrent(addp);
|
|
|
|
|
2016-05-17 15:24:06 +02:00
|
|
|
std::printf("connect_peer: 127.0.0.1:%d\n", peer_port);
|
2018-01-28 00:56:21 +01:00
|
|
|
h.connect_peer({address_v4::from_string("127.0.0.1"), std::uint16_t(peer_port)});
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
std::vector<std::string> accepted_trackers;
|
2013-10-14 10:15:08 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
const int timeout = 30;
|
2013-10-14 10:15:08 +02:00
|
|
|
|
|
|
|
for (int i = 0; i < timeout; ++i)
|
2013-06-12 09:57:13 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
print_alerts(*s, "s", false, false
|
|
|
|
, [&](lt::alert const* a)
|
|
|
|
{
|
|
|
|
if (auto const* ta = alert_cast<tracker_reply_alert>(a))
|
|
|
|
accepted_trackers.push_back(ta->tracker_url());
|
|
|
|
return false;
|
|
|
|
});
|
2016-06-26 15:24:06 +02:00
|
|
|
std::this_thread::sleep_for(lt::milliseconds(100));
|
2013-09-01 02:04:40 +02:00
|
|
|
|
2014-02-23 02:32:55 +01:00
|
|
|
if (num_udp_announces() >= prev_udp_announces + 1
|
2018-07-04 14:49:51 +02:00
|
|
|
&& num_peer_hits() > 0
|
|
|
|
&& !accepted_trackers.empty())
|
2013-09-01 02:04:40 +02:00
|
|
|
break;
|
2013-06-12 09:57:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// we should have announced to the tracker by now
|
2018-07-04 14:49:51 +02:00
|
|
|
TEST_EQUAL(num_udp_announces(), prev_udp_announces
|
|
|
|
+ ((flags & expect_udp_connection) ? 1 : 0));
|
|
|
|
|
|
|
|
if (flags & expect_dht_msg)
|
2015-01-14 02:59:23 +01:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
TEST_CHECK(num_dht_hits() > 0);
|
2015-01-14 02:59:23 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
TEST_EQUAL(num_dht_hits(), 0);
|
2015-01-14 02:59:23 +01:00
|
|
|
}
|
2015-01-27 23:18:13 +01:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
if (flags & expect_peer_connection)
|
2013-06-12 19:03:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
TEST_CHECK(num_peer_hits() > 0);
|
2013-06-12 19:03:56 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
TEST_EQUAL(num_peer_hits(), 0);
|
2013-06-12 19:03:56 +02:00
|
|
|
}
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
if (flags & expect_http_connection)
|
2013-06-13 08:32:13 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
TEST_CHECK(std::find(accepted_trackers.begin(), accepted_trackers.end()
|
|
|
|
, http_tracker_url) != accepted_trackers.end());
|
2013-06-13 08:32:13 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
TEST_CHECK(std::find(accepted_trackers.begin(), accepted_trackers.end()
|
|
|
|
, http_tracker_url) == accepted_trackers.end());
|
2013-06-13 08:32:13 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
if (flags & expect_udp_connection)
|
|
|
|
{
|
|
|
|
TEST_CHECK(std::find(accepted_trackers.begin(), accepted_trackers.end()
|
|
|
|
, udp_tracker_url) != accepted_trackers.end());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TEST_CHECK(std::find(accepted_trackers.begin(), accepted_trackers.end()
|
|
|
|
, udp_tracker_url) == accepted_trackers.end());
|
|
|
|
}
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2016-10-10 02:23:45 +02:00
|
|
|
std::printf("%s: ~session\n", time_now_string());
|
2013-10-20 23:08:59 +02:00
|
|
|
session_proxy pr = s->abort();
|
2018-07-04 14:49:51 +02:00
|
|
|
s.reset();
|
2013-06-12 19:03:56 +02:00
|
|
|
|
2013-06-13 08:32:13 +02:00
|
|
|
stop_peer();
|
2013-06-12 19:03:56 +02:00
|
|
|
stop_dht();
|
2014-02-23 02:32:55 +01:00
|
|
|
stop_udp_tracker();
|
2013-06-12 19:03:56 +02:00
|
|
|
stop_web_server();
|
2013-10-20 23:08:59 +02:00
|
|
|
return pr;
|
2013-06-12 09:57:13 +02:00
|
|
|
}
|
|
|
|
|
2018-01-23 20:56:03 +01:00
|
|
|
} // anonymous namespace
|
|
|
|
|
2015-06-06 08:23:56 +02:00
|
|
|
// not using anonymous mode
|
|
|
|
// UDP fails open if we can't connect to the proxy
|
|
|
|
// or if the proxy doesn't support UDP
|
|
|
|
|
|
|
|
TORRENT_TEST(no_proxy)
|
2013-06-12 09:57:13 +02:00
|
|
|
{
|
2016-11-12 19:50:49 +01:00
|
|
|
test_proxy(settings_pack::none, expect_udp_connection
|
|
|
|
| expect_http_connection | expect_dht_msg | expect_peer_connection);
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
// since we don't actually have a proxy in this test, make sure libtorrent
|
|
|
|
// doesn't send any outgoing packets to either tracker or the peer
|
2015-06-06 08:23:56 +02:00
|
|
|
TORRENT_TEST(socks4)
|
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::socks4, {});
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
TORRENT_TEST(socks5)
|
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::socks5, {});
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
TORRENT_TEST(socks5_pw)
|
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::socks5_pw, {});
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
TORRENT_TEST(http)
|
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::http, {});
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(http_pw)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::http_pw, {});
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
// if we configure trackers to not be proxied, they should be let through
|
|
|
|
TORRENT_TEST(socks4_tracker)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::socks4, dont_proxy_trackers | expect_http_connection | expect_udp_connection);
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
2013-06-12 09:57:13 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(socks5_tracker)
|
|
|
|
{
|
|
|
|
test_proxy(settings_pack::socks5, dont_proxy_trackers | expect_http_connection | expect_udp_connection);
|
|
|
|
}
|
2013-06-13 08:32:13 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(socks5_pw_tracker)
|
|
|
|
{
|
|
|
|
test_proxy(settings_pack::socks5_pw, dont_proxy_trackers | expect_http_connection | expect_udp_connection);
|
|
|
|
}
|
2015-06-06 08:23:56 +02:00
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(http_tracker)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::http, dont_proxy_trackers | expect_http_connection | expect_udp_connection);
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(http_pw_tracker)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::http_pw, dont_proxy_trackers | expect_http_connection | expect_udp_connection);
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
// if we configure peers to not be proxied, they should be let through
|
|
|
|
TORRENT_TEST(socks4_peer)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::socks4, dont_proxy_peers | expect_peer_connection);
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(socks5_peer)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::socks5, dont_proxy_peers | expect_peer_connection);
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(socks5_pw_peer)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::socks5_pw, dont_proxy_peers | expect_peer_connection);
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(http_peer)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::http, dont_proxy_peers | expect_peer_connection);
|
|
|
|
}
|
|
|
|
|
|
|
|
TORRENT_TEST(http_pw_peer)
|
|
|
|
{
|
|
|
|
test_proxy(settings_pack::http_pw, dont_proxy_peers | expect_peer_connection);
|
2015-06-06 08:23:56 +02:00
|
|
|
}
|
|
|
|
|
2017-12-02 19:33:56 +01:00
|
|
|
#if TORRENT_USE_I2P
|
2018-07-04 14:49:51 +02:00
|
|
|
TORRENT_TEST(i2p)
|
2015-06-06 08:23:56 +02:00
|
|
|
{
|
2018-07-04 14:49:51 +02:00
|
|
|
test_proxy(settings_pack::i2p_proxy, {});
|
2013-06-12 09:57:13 +02:00
|
|
|
}
|
2017-12-02 19:33:56 +01:00
|
|
|
#endif
|