Surround IPv6 addresses by square braquets in HTTP CONNECT requests
This commit is contained in:
parent
89b37e9f4c
commit
7a2feba897
@ -20,7 +20,13 @@ void HttpProxy::send_connect() {
|
||||
CHECK(state_ == State::SendConnect);
|
||||
state_ = State::WaitConnectResponse;
|
||||
|
||||
string host = PSTRING() << ip_address_.get_ip_str() << ':' << ip_address_.get_port();
|
||||
string host;
|
||||
if (ip_address_.is_ipv6()) {
|
||||
host = PSTRING() << "[" << ip_address_.get_ip_str() << "]" << ':' << ip_address_.get_port();
|
||||
} else {
|
||||
host = PSTRING() << ip_address_.get_ip_str() << ':' << ip_address_.get_port();
|
||||
}
|
||||
|
||||
string proxy_authorization;
|
||||
if (!username_.empty() || !password_.empty()) {
|
||||
auto userinfo = PSTRING() << username_ << ':' << password_;
|
||||
|
Reference in New Issue
Block a user