Do you know what can I do to check if proxy in WebBrowser is working properly?
+1
A:
Well, if the proxy does not exist, you will have an error:
WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_8, "localhost", 8080); HtmlPage page = webClient.getPage("http://htmlunit.sf.net"); System.out.println(page.asText());
org.apache.http.conn.HttpHostConnectException:
Connection to http://localhost:8080 refused at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:127) at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)
- If the proxy misbehaves, you will have a different page than what you expected
Ahmed Ashour
2010-09-04 02:00:06
Can I catch it by try and catch ?
oneat
2010-09-04 07:57:06
Sure you can, why not?
Ahmed Ashour
2010-09-06 11:07:26