?
Solved

Authenticator firewall problem

Posted on 2001-08-22
3
Medium Priority
?
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
Sendoh earned 800 total points
ID: 6412668
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
ID: 6413442
Perfect!
Many thanks.
0
 
LVL 3

Expert Comment

by:Sendoh
ID: 6415999
no prob...:)
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

650 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