mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-30 01:06:09 +03:00
net: Allow http proxies in proxy chains
This commit is contained in:
parent
995ae75efd
commit
80d7fe42c1
@ -192,7 +192,7 @@ bool ProxyChain::IsValidInternal() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
seen_quic = true;
|
seen_quic = true;
|
||||||
} else if (proxy_server.is_https()) {
|
} else if (proxy_server.is_https() || proxy_server.is_http()) {
|
||||||
seen_https = true;
|
seen_https = true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -488,9 +488,17 @@ int HttpProxyConnectJob::DoBeginConnect() {
|
|||||||
int HttpProxyConnectJob::DoTransportConnect() {
|
int HttpProxyConnectJob::DoTransportConnect() {
|
||||||
ProxyServer::Scheme scheme = GetProxyServerScheme();
|
ProxyServer::Scheme scheme = GetProxyServerScheme();
|
||||||
if (scheme == ProxyServer::SCHEME_HTTP) {
|
if (scheme == ProxyServer::SCHEME_HTTP) {
|
||||||
|
if (params_->is_over_transport()) {
|
||||||
nested_connect_job_ = std::make_unique<TransportConnectJob>(
|
nested_connect_job_ = std::make_unique<TransportConnectJob>(
|
||||||
priority(), socket_tag(), common_connect_job_params(),
|
priority(), socket_tag(), common_connect_job_params(),
|
||||||
params_->transport_params(), this, &net_log());
|
params_->transport_params(), this, &net_log());
|
||||||
|
} else if (params_->is_over_http()) {
|
||||||
|
nested_connect_job_ = std::make_unique<HttpProxyConnectJob>(
|
||||||
|
priority(), socket_tag(), common_connect_job_params(),
|
||||||
|
params_->http_params(), this, &net_log());
|
||||||
|
} else {
|
||||||
|
CHECK(false) << "Invalid nested connect job";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
DCHECK_EQ(scheme, ProxyServer::SCHEME_HTTPS);
|
DCHECK_EQ(scheme, ProxyServer::SCHEME_HTTPS);
|
||||||
DCHECK(params_->is_over_ssl());
|
DCHECK(params_->is_over_ssl());
|
||||||
|
@ -100,6 +100,13 @@ class NET_EXPORT_PRIVATE HttpProxySocketParams
|
|||||||
return quic_ssl_config_;
|
return quic_ssl_config_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_over_http() const {
|
||||||
|
return nested_params_ && nested_params_->is_http_proxy();
|
||||||
|
}
|
||||||
|
const scoped_refptr<HttpProxySocketParams>& http_params() const {
|
||||||
|
return nested_params_->http_proxy();
|
||||||
|
}
|
||||||
|
|
||||||
const HostPortPair& endpoint() const { return endpoint_; }
|
const HostPortPair& endpoint() const { return endpoint_; }
|
||||||
const ProxyChain& proxy_chain() const { return proxy_chain_; }
|
const ProxyChain& proxy_chain() const { return proxy_chain_; }
|
||||||
const ProxyServer& proxy_server() const {
|
const ProxyServer& proxy_server() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user