Re: How to set proxy?
"CORUM, M E [AG/1000]" <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <67ABD23687EA2A4FBB847F157EFAD6CF0173E86E@NA1000EXM03.na.ds.monsanto.com> |
The reason is may not be working for you is that httpunit uses an old and
now unsupported method of setting the proxy in Java. Here is some code from
a proxy that we use for testing Kerberos-enabled sites using httpunit:
//ToDo: Old variables for backward compatibility - like httpunit does it
internally
//System.setProperty("proxyHost", TEST_HOST_NAME);
//System.setProperty("proxyPort", String.valueOf(PROXY_PORT));
//ToDo: New variables since about 2000
System.setProperty("http.proxyHost", TEST_HOST_NAME);
System.setProperty("http.proxyPort", String.valueOf(PROXY_PORT));
//ToDo: Setting keepAlive to false is CRITICAL in avoiding errors requiring
sleeps
System.setProperty("http.keepAlive", "false");
It's OK to set the old variables and I've even seen it work "sort of" but it
is really best to just set it yourself manually using the new supported
variables.
Mike Corum
-----Original Message-----
Date: Mon, 18 Sep 2006 23:18:05 +0800
From: "wolverine my" <[email protected]>
Subject: [Httpunit-develop] How to set proxy?
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi!
I try to set proxy to the WebClient (using 1.62):
WebConversation wc = new WebConversation();
wc.setProxyServer("localhost", 80);
System.out.println(wc.getProxyHost());
System.out.println(wc.getProxyPort());
However the result is
null
0
It seem that the setProxyServer is not working correctly??
------------------------------
---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.
All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.
---------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV