improved SOCKS5 support

This commit is contained in:
Arvid Norberg
2010-08-03 09:08:37 +00:00
parent e7561e5274
commit fd5f1bf80b
22 changed files with 434 additions and 79 deletions

View File

@@ -75,8 +75,16 @@ namespace libtorrent
// send CONNECT
std::back_insert_iterator<std::vector<char> > p(m_buffer);
write_string("CONNECT " + print_endpoint(m_remote_endpoint)
+ " HTTP/1.0\r\n", p);
std::string endpoint;
if (!m_hostname.empty())
{
endpoint = m_hostname + ':' + to_string(m_remote_endpoint.port()).elems;
}
else
{
endpoint = print_endpoint(m_remote_endpoint);
}
write_string("CONNECT " + endpoint + " HTTP/1.0\r\n", p);
if (!m_user.empty())
{
write_string("Proxy-Authorization: Basic " + base64encode(