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

web_proxy doesn't work when using port numbers in address #57

Open
petke opened this issue Jan 18, 2016 · 1 comment
Open

web_proxy doesn't work when using port numbers in address #57

petke opened this issue Jan 18, 2016 · 1 comment

Comments

@petke
Copy link

petke commented Jan 18, 2016

I tested this with v2.7.0 and v2.1.0 (with vc12 and vc14 on win10 and server2012), on about 20 proxy machines I know are good. I though it had worked with some old cpprest version but probably not. (I know the proxies are fine as I use them fine through libcurl).

Minimal example: I get the error "web::uri_exception: provided uri is invalid":

#include <cpprest/http_client.h>
int main() {
    try {
        //web::http::client::web_proxy wp2(L"123.123.123.123"); //OK
        web::http::client::web_proxy wp2(L"123.123.123.123:1234"); //Error
        std::cout << "OK" << std::endl;
    }
    catch (const std::exception& exc) {
        std::cerr << exc.what() << std::endl;
    }
}
@ras0219-msft
Copy link
Contributor

Ok, looking into this issue it seems like we have a parser bug. Fortunately, there's a simple workaround: specify the protocol (http I assume) in the URI:
web::http::client::web_proxy wp2(L"http://123.123.123.123:1234"); //OK
It will also work with simply prepending a double slash:
web::http::client::web_proxy wp2(L"//123.123.123.123:1234"); //OK

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

No branches or pull requests

2 participants