0

I want to fetch a URL with java.net but any connection is refused. I know that when I ask for a page, my browser (IE) uses my Windows login ID to authenticate me, then pass my request through a proxy. Can someone please help me translate this process into the Java libraries and steps to fetch webpage? Thank you.

EDIT: - I'm not sure what kind of authentication it uses here. Before any page is retrieved, it pops up a login window where I have to type in my domain\userid and password. How can I figure out the type of authentication?
- The proxy changes via an automatic configuration script.

3 Answers 3

1

I recommend you use HttpClient, which makes authentication very simple:

http://hc.apache.org/httpclient-3.x/authentication.html

It's not clear from your question what exactly the role of the proxy is here in authenticating you, but a combination of HttpClient + the right headers (if you need them) should be sufficient.

Sign up to request clarification or add additional context in comments.

Comments

0

You can configure the Java runtime to use a proxy for Network comms. See this article.

Comments

0

You may want to try

java.net.Authenticator.setDefault(yourCustomAuthenticator);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.