mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-22 16:02:29 +02:00
HTTPSessionInstantiator: respect global proxy config
This commit is contained in:
@@ -41,8 +41,11 @@ HTTPClientSession* HTTPSessionInstantiator::createClientSession(const Poco::URI&
|
|||||||
{
|
{
|
||||||
poco_assert (uri.getScheme() == "http");
|
poco_assert (uri.getScheme() == "http");
|
||||||
HTTPClientSession* pSession = new HTTPClientSession(uri.getHost(), uri.getPort());
|
HTTPClientSession* pSession = new HTTPClientSession(uri.getHost(), uri.getPort());
|
||||||
|
if (!proxyHost().empty())
|
||||||
|
{
|
||||||
pSession->setProxy(proxyHost(), proxyPort());
|
pSession->setProxy(proxyHost(), proxyPort());
|
||||||
pSession->setProxyCredentials(proxyUsername(), proxyPassword());
|
pSession->setProxyCredentials(proxyUsername(), proxyPassword());
|
||||||
|
}
|
||||||
return pSession;
|
return pSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,8 +43,11 @@ HTTPClientSession* HTTPSSessionInstantiator::createClientSession(const Poco::URI
|
|||||||
{
|
{
|
||||||
poco_assert (uri.getScheme() == "https");
|
poco_assert (uri.getScheme() == "https");
|
||||||
HTTPSClientSession* pSession = _pContext.isNull() ? new HTTPSClientSession(uri.getHost(), uri.getPort()) : new HTTPSClientSession(uri.getHost(), uri.getPort(), _pContext);
|
HTTPSClientSession* pSession = _pContext.isNull() ? new HTTPSClientSession(uri.getHost(), uri.getPort()) : new HTTPSClientSession(uri.getHost(), uri.getPort(), _pContext);
|
||||||
|
if (!proxyHost().empty())
|
||||||
|
{
|
||||||
pSession->setProxy(proxyHost(), proxyPort());
|
pSession->setProxy(proxyHost(), proxyPort());
|
||||||
pSession->setProxyCredentials(proxyUsername(), proxyPassword());
|
pSession->setProxyCredentials(proxyUsername(), proxyPassword());
|
||||||
|
}
|
||||||
return pSession;
|
return pSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user