Solved

Authenticator firewall problem

Posted on 2001-08-22
3
215 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pagenation logic how it is working in my code 1 82
printf performancy 11 102
swing controls 2 37
Selenium findElement(By.classname  identifier 15 33
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

734 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