-
Notifications
You must be signed in to change notification settings - Fork 38
Https proxy support #22
Https proxy support #22
Conversation
We don't really have the resources to maintain a fork of Poco. Last time we (I) had to update it, it took half a year of on-and-off attempts to port all the patches, resolve cryptic conflicts and debug mysterious integration test failures. It sure took its toll on my wellbeing, and the next person asked to do will be probably better off just resigning immediately. So, some suggestions:
On a less apocalyptic note, do you have a PR in the main repo that will make use of this functionality? We sure need an integration test for it. And please add a description to the PR -- you add an option to use CONNECT proxy as opposed to MITM proxy functionality that Poco already implements, right? |
From TG (in Russian):
|
Net/src/HTTPClientSession.cpp
Outdated
proxyUri.setHost(getProxyHost()); | ||
proxyUri.setPort(getProxyPort()); | ||
|
||
SharedPtr<HTTPClientSession> proxySession (HTTPSessionFactory::defaultFactory().createClientSession(proxyUri)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand where and how the suggested separate factory _proxySessionFactory
is used (with which the proxies for "http/s" are registered).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Forgot to use it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
GCS server does not handle requests with port, and simply report an error: ```xml <?xml version="1.0"?> <?xml version='1.0' encoding='UTF-8'?> <Error> <Code>InvalidURI</Code> <Message>Couldn't parse the specified URI.</Message> <Details>Invalid URL: storage.googleapis.com:443/...</Details> </Error> ``` Removing the port fixes the issue. Note that there is port in the Host header anyway. Note, this is a problem only for proxy in a tunnel mode, since only it sends such requests, other sends requests directly via HTTP methods. Refs: ClickHouse/poco#22 (comment) (cc @Jokser) Refs: ClickHouse/poco#63 Refs: ClickHouse#38069 (cc @CurtizJ) Cc: @alesapin @kssenii Signed-off-by: Azat Khuzhin <[email protected]>
pocoproject#3035
Added possibility to connect to HTTPS proxy.
Not all proxies support CONNECT request, so it's possible to send a request directly to HTTPS proxy without CONNECT request. This behavior is controlled by the proxy tunnel option which is 'true' by default for backward-compatibility.
In the case of HTTP endpoint and HTTP proxy, there is no tunneling despite the tunnel option is true by default. This was done also for backward-compatibility.