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
Can not work proxy auth #13
Comments
I need to find a sample proxy server that requires authentication. Do you have one that is available publicly ? |
maybe that one : https://github.com/liggitt/auth-proxy |
quite stupid mistake in the code. I will patch right away. |
Thanks for the notice. |
Tested locally, cannot write an unit test unfortunately. |
pushing 0.0.18 |
Hi Thanks for the response and the patch . It does not work when setting authentication information with the -x option.
|
new unit tests : @Test
public void proxyWithAuthentication2 () {
//given
CommandLine commandLine = ReadArguments.getCommandLineFromRequest (
"-x http://localhost:80/ -U jack:insecure http://www.google.com/");
//when
HttpUriRequest request = HttpRequestProvider.prepareRequest (commandLine);
//then
assertEquals (request.getFirstHeader ("Proxy-Authorization").getValue (),
"Basic amFjazppbnNlY3VyZQ==");
assertEquals(((HttpGet)request).getConfig().getProxy().toString(), "http://localhost:80");
}
@Test
public void proxyWithAuthentication3 () {
//given
CommandLine commandLine = ReadArguments.getCommandLineFromRequest (
"-x http://jack:insecure@localhost:80/ http://www.google.com/");
//when
HttpUriRequest request = HttpRequestProvider.prepareRequest (commandLine);
//then
assertEquals (request.getFirstHeader ("Proxy-Authorization").getValue (),
"Basic amFjazppbnNlY3VyZQ==");
assertEquals(((HttpGet)request).getConfig().getProxy().toString(), "http://localhost:80");
} |
I did not work with https proxies yet. But it will work with the http://user:password@hostname from the version 0.0.19 |
closing since no activity in the feed for one week. |
Hi
Describe the bug
Environment
Use an authentication proxy server.
Curl command line
libe.txt
The text was updated successfully, but these errors were encountered: