I dont get any exception. It just gets blocked and sits doing nothing.
I found another approach on going through a proxy and tried the following VM arguments -Dhttp.proxyHost=webproxy.blah.com -Dhttp.proxyPort=80
and just a normal socket call, with no Proxy used in the code. By doing this, i am able to connect to a machine that is not firewalled (the proxy code wouldnt even connect to that machine), but with my destination machine i get "java.net.SocketTimeoutException: connect timed out" ( I increased the timeout to 5 seconds btw)
any comments on this? Is there any way to find out if these connections are indeed going through the proxy?
What is the standard way of doing this? I couldnt find much documentation on using proxies.
Originally posted by Atulya Mahajan: I dont get any exception. It just gets blocked and sits doing nothing. . . . i get "java.net.SocketTimeoutException: connect timed out" ( I increased the timeout to 5 seconds btw)
Do you get an exception or not? How long does it take to access the same resource with a browser? More than 5 seconds?
1. Create proxy object and pass to socket constructor.
This gets blocked. I get no exception
2. Create socket as usual. Pass in http.proxyHost and http.proxyPort JVM arguments to the application.
This method works with a non firewalled machine, but with the machine outside our network that i want to connect to, i get the timeout. I tried even a 50 sec timeout. It certainly doesnt take that long to connect to this machine.