Results 1 to 3 of 3
- 03-05-2010, 12:03 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 7
- Rep Power
- 0
Connection failure due to proxy problems
Hi All,
Please suggest me that how to identify that any connection failure exception is caused due to proxy problems. I mean how can i differentiate the other connection failures vs proxy.
Objective: I have to display a message to user in my application (desktop app) saying that 'not able to connect to server due to proxy problems' if any problems occured in connecting to a site due to local proxy issues.
and also displaying different messages for connection request time out, session time out and etc.
Please let suggest the approach or any example will be greatly appreciated.
Thanks in advance.
-Ravi T
- 03-06-2010, 02:03 AM #2
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
Can this help:
Java Tips - How to detect Proxy Settings for Internet Connection
Check javadoc for ProxySelector class
there is method:
Java Code:[B]connectFailed[/B] public abstract void connectFailed(URI uri, SocketAddress sa, IOException ioe) Called to indicate that a connection could not be established to a proxy/socks server. An implementation of this method can temporarily remove the proxies or reorder the sequence of proxies returned by select(String, String), using the address and they kind of IOException given.
- 03-10-2010, 02:52 PM #3
Member
- Join Date
- Feb 2010
- Posts
- 7
- Rep Power
- 0
Required more info
Hi FON,
Thanks for your quick response. I have implemented custom proxy select to override connectFailed() method. But it never called, even if i given incorrect proxy host name.
Can you please suggest that how can i validate given proxy details and identify the problem.
Please find my sample code in attachments.
When i have tested the program with valid proxy host, port and incorrect credentials of proxy. It is displaying response like below. Which is expected behaviour and useful for me.
Response msg=Proxy Authentication Required
Response Code=407
Thanks,
Ravi T
Similar Threads
-
Problems while getting data from weblogic server when using connection pooling
By jason.3dmagic in forum New To JavaReplies: 12Last Post: 02-17-2010, 07:50 AM -
SQLException: Communications link failure
By etherkye in forum JDBCReplies: 0Last Post: 07-03-2009, 04:20 PM -
Connect to HTTPS + SSL handshake failure
By jamojo in forum Advanced JavaReplies: 3Last Post: 06-25-2009, 11:04 PM -
Animation failure...
By lordbob75 in forum New To JavaReplies: 10Last Post: 05-11-2009, 02:06 AM -
Http - proxy or non-proxy ?
By Shiv in forum NetworkingReplies: 0Last Post: 04-11-2009, 08:07 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks