Solved

Authenticator firewall problem

Posted on 2001-08-22
3
204 Views
Last Modified: 2008-03-06
Hello,

I'm having trouble getting my program to retrieve URLs from outside of our firewall. I am using this call to the setDefault method :-

   Authenticator.setDefault(new RicksAuthenticator());


Where RicksAuthenticator is this as an inner class :


public class RicksAuthenticator extends Authenticator
{
    protected PasswordAuthentication getPasswordAuthentication()
    {
        // this is my proxy server username/password
        String username = "richard";
        char[] mypass = {'p','a','s,'s','w','o','r','d'};
        return new PasswordAuthentication(username, mypass);
    }  
}    

I then try and get a web page on the internet using java.net.URL but it just times out. When I point it to a page this side of the firewall it works fine.

Is there some way I have to explicitly specify the address/port number of the proxy server so that my program is forced to use it?

Many thanks,

Richard.
0
Comment
Question by:rick2001
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
Sendoh earned 200 total points
Comment Utility
hi ! think u can try

System.setProperty("http.proxyHost",ipAddressProxyIP);
System.setProperty("http.proxyPort",ipAddressProxyPort);

hope this helps...:P
0
 
LVL 1

Author Comment

by:rick2001
Comment Utility
Perfect!
Many thanks.
0
 
LVL 3

Expert Comment

by:Sendoh
Comment Utility
no prob...:)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now