?
Solved

Authenticator firewall problem

Posted on 2001-08-22
3
Medium Priority
?
219 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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.
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 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