Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port number is not passed to proxy server #87

Open
JackieKu opened this issue Apr 11, 2019 · 1 comment
Open

Port number is not passed to proxy server #87

JackieKu opened this issue Apr 11, 2019 · 1 comment
Assignees
Labels

Comments

@JackieKu
Copy link

If a proxy is configured and the target service is running on a non-default port number (80 for http://, and 443 for https://), the connection always fails because the port number is not passed to the proxy server.

Purposed fix

diff --git a/src/RequestImpl.cpp b/src/RequestImpl.cpp
index bf7c862..f8028ab 100644
--- a/src/RequestImpl.cpp
+++ b/src/RequestImpl.cpp
@@ -179,7 +179,7 @@ private:
         request_buffer << Verb(request_type_) << ' ';
 
         if (properties_->proxy.type == Request::Proxy::Type::HTTP) {
-            request_buffer << parsed_url_.GetProtocolName() << parsed_url_.GetHost();
+            request_buffer << parsed_url_.GetProtocolName() << parsed_url_.GetHost() << ':' << parsed_url_.GetPort();
         }
 
         // Add arguments to the path as ?name=value&name=value...
@jgaa
Copy link
Owner

jgaa commented Apr 12, 2019

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants