Can't connect throut proxy to the Web.

I can't connect through proxy to the Web by use URLConnection or HttpURLConnection.
I used:
Properties prop = System.getProperties();
prop.put("http.proxyHost","your-proxy-host");
prop.put("http.proxyPort","proxy-port");
get err:
Error Code: 407 (Proxy Authentication Required).
Error: Access is Denied.
1. How can I setup my app to work through a proxy server?
I think that is must the proxy server get username and password, because browser demand login too, when connect URL via proxy.
2. How can I send username and password to the proxy server?
PS: with browser (IE) I connect to the Web perfectly.
Thanks,
Hill

See if this works:
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.util.*;
public class randomYahooLink
{     private      URL randomYahooLinkURL;
     private      String pageSource;
     private     JEditorPane pageHolder = new JEditorPane();
     public randomYahooLink()
     {     System.out.println("Entering default constructor.");
          try
          {     randomYahooLinkURL = new URL "http://random.yahoo.com/bin/ryl");
          }     catch(MalformedURLException MUE)
          {     System.out.println("ERROR: Malformed URL!");
          System.out.println("-fin- default constructor");
     public randomYahooLink(String proxyHost, String proxyPort)
     {     System.out.println("Entering proxy constructor.");
          System.getProperties().put("proxyHost", proxyHost);
          System.getProperties().put("proxyPort", proxyPort);
          try
          {     randomYahooLinkURL = new URL("http://random.yahoo.com/bin/ryl");
          }     catch(MalformedURLException MUE)
          {     System.out.println("ERROR: Malformed URL!");
          System.out.println("-fin- proxy constructor");
          public void getPage()
     {     System.out.println("Entering getPage() function");
          try
          {     pageHolder.setPage(randomYahooLinkURL);
          } catch (IOException IO)
          {     System.out.println("ERROR: Could not retrieve link.");
          } catch (Exception e)
          {     System.out.println("ERROR: Some unknown error thing.");
          System.out.println("-fin- getPage()");
     public void displayResults()
     {     System.out.println("Entering displayResults() function.");
          try
          {     pageSource = pageHolder.getText();
               System.out.println("RETRIEVED " + pageSource.length() + " bytes of data");
          } catch (Exception e)
          {     System.out.println("ERROR: Could not display results.");
          System.out.println("-fin- displayResults()");
     public static void main(String args[])
     {     boolean done = false;
          long thisTime;
          randomYahooLink thisLink = new randomYahooLink("proxy","port");
          System.out.println("Program initialized.");
          while (!done)
          {     try
               {     thisLink.getPage();
                    thisTime = System.currentTimeMillis();
                    while (System.currentTimeMillis() < thisTime + 5000)
                    {     // do something
                    thisLink.displayResults();
               } catch (Exception e)
               {     System.out.println("ERROR in main program loop.");
          System.out.println("Completed program.");
}email me at [email protected] if you have trouble.

Similar Messages

  • I have CD version of Adobe Photoshop Element 9. I have CD version of Adobe Photoshop Element 9. I have purchased the new Macbook which does not have DVD drive. Can I download this software over the web and install using the Serial Number I have. Thanks,

    I have CD version of Adobe Photoshop Element 9. I have CD version of Adobe Photoshop Element 9. I have purchased the new Macbook which does not have DVD drive. Can I download this software over the web and install using the Serial Number I have. Thanks,@

    yes,
    Downloads available:
    Suites and Programs:  CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • HT201263 Hi when i connect my iphone to pc to use itunes it said :iphone can not connected to itunes bcs the device service is not started so ido not know what can i do!

    phone can not connected to itunes bcs the device service is not started so ido not know what can i do!

    restart apple mobile device in windows http://support.apple.com/kb/TS1567

  • Can I connect my ipad to the tv and record to DVD HDD

    Can I connect my ipad to the tv and record to DVD HDD

    You don't need Apple TV.  But you do need the Apple Composite cable to connect your iPad to your TV.
    http://store.apple.com/us/product/MC748ZM/A?fnode=MTc0MjU4NjE
    You can also use the VGA Adapter as well.
    http://store.apple.com/us/product/MC552ZM/B?fnode=MTc0MjU4NjE

  • Form fields in LiveCycle. I want to allow users to add URLs to a form so that they can be clicked and opened on the web by form reviewers (users). what is the best way to achieve this?

    Form fields in LiveCycle. I want to allow users to add URLs to a form so that they can be clicked and opened on the web by form reviewers (users). what is the best way to achieve this?

    Once the user has entered the URL they want to add to the form. You can use the loadXML function to implement some special text in a label...
    var linkValue = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><exData contentType=\"text/html\" xmlns=\"http://www.xfa.org/schema/xfa-template/2.8/\"><body xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\" xfa:APIVersion=\"Acroform:2.7.0.0\" xfa:spec=\"2.1\"><p style=\"font-weight:bold;text-decoration:none;letter-spacing:0in\">The new link the user have entered is:<a href=\"" + textfield.rawValue + "\">textfield.rawValue</a></p></body></exData>";
      this.resolveNode("lblURL").value.exData.loadXML(linkValue, 1, 1);

  • Satellite L20-101: can't connect my TV with the svhs

    Hi dudes,
    i have a problem.
    I have a L20 - 101 and i can't connect my tv with the svhs exit of my toshiba.
    I reinstalled drivers for motherboard and videographics, what can i try?
    thanks

    Ok, sounds like a really un-nice problem.
    So, how do you try to switch to the TV? You have the option in your display properties, but does the machine *recognize* the TV? You have also the key combination FN+F5 to change the display, did you already tried it?
    And regarding your display drivers (which vga do you have? nvidia or ati?)
    You can take a look here to find the latest working drivers for mobile platforms:
    http://www.laptopvideo2go.com/
    http://www.omegadrivers.net/
    Good luck buddy

  • I can't watch some videos in the web

    i can't watch some videos from the web, it tells me that i need the latest version of adobe flash player, and i have installed already , but still  the same problem. specially with youtube videos.

    What is your operating system & browser?
    What is your installed Flash Player version?

  • I can't connect to itunes store the alert error says "itunes could not connect to the itunes store. An unknown error occurred (0x80092013)"

    i can't connect to itunes store the alert error says "itunes could not connect to the itunes store. An unknown error occurred (0x80092013)"

    Hi all,
    I have the same problem with my Windows 8.1 laptop and my guess is that since I changed my Internet Provider who now delivers IPv6 addresses the problem occurs. A frieend who has a different provider does not have the problem in his home, but when he tries using iTunes at my home with my network he gets the same problem.
    I have already solved a previous problem with Outlook 2003 not being able to receive emails from my wifes GMail account although everything else worked fine. The solution here was to enter the IPv4 address of Google POP-Server in the hosts file, overriding the IPv6 address.
    Maybe something similar helps with this iTunes error.
    If someone knows the hostname of the iTunes Store server, it could be pinged and the IPv4 address could be determined and then entered in the HOSTS file.
    I'll continue trying in this direction and will post a solution if I find one.
    If someone has the iTunes server name or IPv4 address, please post it.

  • HT4847 where can i see my photos in the web?

    where can i see my photos in the web?

    You can only veiw your photos on the web by creating a shared photo stream as a public website, as explained here: http://help.apple.com/icloud/#mmc0cd7e99.  This will give you a url to view your photos from any browser.

  • HT4623 I can not connect my Ipad to the internet

    I can not connect my Ipad to the internet

    We cannot help unless you provide some more information. You have to let us know what you have tried, where you tried it ....

  • How can we publish Labview data using the web

    how can we publish Labview data using the web?
    Dr. Eugene Berman, Moran Kamilyan and Ravit Bar

    [email protected] wrote:
    how can we publish Labview data using the web?
    You could use shared variables and publish them to the network or use data sockets.
    Kudos always welcome for helpful posts

  • I can't install Flash Builder from the Web Premium suite, what should I do?

    I just downloaded the Adobe Creative suite 5.5 Web Premium and am about to install the program but notice a note next to the Adobe Flash Builder program... it explains that my system doesn't have the requirements needed for this program. I checked and it explains further details stating that I need to have a • Mac OS X v10.5.6–10.6 and I doubled check which version I have and it's OS X 10.5.8. Doesn't this actually mean that it does meet the requirements?
    Please advise as to what can be done to be able to download this specific program.
    Thanks,
         Sarah-Kay

    ok,
    so for the memory:      it's 4 GB 1067 MHz DDR3 and when I click to 
    install the programs it says (Macintosh HD: 10,0 Go (459,5 Go 
    disponible).
    As for the processor:  it's 2.66 GHz Intel Core 2 Duo
    Monitor resolution:    1920 x 1200
    Le 12-02-28 à 17:35, Jeff A Wright a écrit :
    Re: I can't install Flash Builder from the Web Premium suite, what 
    should I do?
    created by Jeff A Wright in Downloading, Installing, Setting Up - 
    View the full discussion
    We do still need more information such as how much memory you have, 
    resolution of your monitor, how much disk space you have free, which 
    processor are you using.  I good guide is to look at the system 
    requirements and try to post for each of the items within the 
    requirements.  The system requirements for Web Premium can be found 
    at http://www.adobe.com/products/creativesuite/web/tech-
    specs.edu.html.
    >
    Also you can find this information within your System Profiler.  The 
    easiest way to access the system profiler is to go to the Apple Menu 
    and select About this Mac.  Once selected clicking on the more info 
    button will launch the System Profiler.
    Replies to this message go to everyone subscribed to this thread, 
    not directly to the person who posted the message. To post a reply, 
    either reply to this email or visit the message page: [http://forums.adobe.com/message/4235635#4235635
    To unsubscribe from this thread, please visit the message page at [http://forums.adobe.com/message/4235635#4235635
    ]. In the Actions box on the right, click the Stop Email 
    Notifications link.
    Start a new discussion in Downloading, Installing, Setting Up by 
    email or at Adobe Forums
    For more information about maintaining your forum email 
    notifications please go to http://forums.adobe.com/message/2936746#2936746

  • Safari 5.0.1 can't connect to proxy server (when 5.0 could)

    Hi,
    I use a MacBook Pro at home and at work. At work I have to access the internet via an http proxy server.
    After updating Safari to 5.0.1 I now get a "Safari can’t open the page “http://www.openstreetmap.org/” because Safari can’t connect to the web proxy server (HTTP)." and then goes on to tell me how to access my proxy settings in System Preferences. Safari works fine at home, accessing the internet via ADSL.
    Camino works fine, OSX Software Update works fine. I have the same problem with extensions enabled/disabled. I do have the WebSnapper plugin working but this was not a problem with 5.0. I have tried resetting Safari but to no avail.
    Any ideas
    Thanks
    Iain

    HI Ian,
    Please click My Settings on the right side of this page and tell us which Mac OS X you are running. Thanks!
    I do have the WebSnapper plugin working but this was not a problem with 5.0
    Turn off Extensions, try Safari using that proxy server. That extension may have been compatible with the previous version of Safari, but not the latest update.
    Carolyn

  • Safari can't connect through proxy

    I just installed OS X 10.5.6 on a new MBP and migrated my old 10.4.11 PB account. Now when I connect to a vpn and set a proxy to be used, every web access times out.
    But this only happens with Safari! When I use the same settings in FireFox, I can perfectly access the web.
    What also puzzles me is: When checking the proxy settings in terminal, I get a segmentation fault:
    # networksetup -getwebproxy airport
    Enabled: Yes
    Server: proxy01.domain.secret.com
    Port: 8080
    Segmentation fault
    Also when I telnet to proxy01.domain.secret.com on port 8080 and give it a HTTP command like
    GET http://google.com/ HTTP/1.0
    I get a proper response. But still Safari is not using the proxy.

    I entered the proxy manually.
    But in the meantime I got the slight suspicion that it might be vpnc that's causing the trouble.

  • Safari Can't Connect To Proxy Server - Why?

    I was using Safari with a proxy server on my Macbook Pro for the last week or so, because people who log ip addresses on places like LiveJournal etc annoy me and I'd rather not reveal all to whoever happens to be looking. It was all working fine, then suddenly when I went to use it this morning, Safari won't connect through a proxy server at all, no matter what I do. All I get is; +Safari can’t open the page “http://www.google.com/” because Safari can’t connect to the web proxy server (HTTP).+
    I know the ip address I'm using is fine because it will work in Firefox, and not only that, Safari on my sister's Macbook will accept that same ip address and load webpages fine, so it's obviously something screwy over here. I hadn't touched settings or anything between using it yesterday and it not working today. I've even updated Safari to see if that's the problem. It's not, and I'm stuck as to why it's suddenly thrown a hissy fit.

    Hello !
    Does Software Update from Apple menu connect? If not
    Go to:
    System Preference > Network.
    Click Advanced.
    Click Proxies Tab on top.
    In Configure Proxies box click up-down arrows for the pop-up window and select Manually.
    In the pane that opens up make sure no box is checked, if checked uncheck it.
    Click OK at the bottom of the window.
    Click Apply at the bottom of the window.
    Close System Preference.
    Relaunch Safari. It should connect. This worked for me.
    Firefox does not use the Proxy system Safari uses.

Maybe you are looking for

  • Table for combination of Purchase requestition doc type and Purchase order doc type

    Hi, scenario: Purchase requestion has document type of Direct purchase which has allowable item category "Standard, consignment, subcontracting, third party and stock transfer". Purchase order has document type of indirect purchase which has allowabl

  • How can I manually change contrast/brightness/colors?

    I want to simply use some slider to adjust the contrast, brightness, gamma or color balance in my MacBook Pro, but for some reason I'm unable to find it. All I can find is the calibration process, but when I calibrate it "correctly", the screen is a

  • JSP to Excel question

    Hi, I have a jsp page that renders data from a result set (queried from database). A button on this pages calls a 2nd page that I want to re-query and open excel with the data. This all works except that there are a number of blank likes at the top o

  • How to do Indepth table analysis without using any tool

    Is there anyway of indepth analysis of tables of a database without using any tool, i.e. by means of sql's, pl/sql's only. My database has around 800 main tables which have several other related relational tables(objects relating 2 tables on basis of

  • File vault: Die angegebene Festplatte wird von einem Treiber verwendet

    Fehlermeldung File vault: Die angegebene Festplatte wird von einem Treiber verwendet. Was kann ich tun, um File Vault zu aktivieren?