Hello Ronald,

There are some examples in cvs. You can get to them here:

http://cvs.apache.org/viewcvs/jakarta-commons/httpclient/src/examples/

I get the impression that HttpClient is not being used much in applets. This explains why there is no built-in support for the browser proxy settings. There has been a little work is creating a HttpUrlConnection implementation, but again without proxy support. If you want to work on this please feel free to submit a patch. Take a look at the following for some guidelines:

http://jakarta.apache.org/site/source.html#Patches

The host configuration is used as a default but can be overridden by the methods. If you want to use host config to set defaults you can use the instance provided by HttpClient.

Mike

On Tuesday, February 18, 2003, at 06:56 AM, Ronald Klop wrote:

Hello,

Are there any howto's about the usage of this package? I can only find the API, but some examples are always more clear.

And why aren't the proxy settings not used by the package?
I now made this method to create the HostConfiguration, but it would be nice if it's in the package automaticly.

private static HostConfiguration getHostConfiguration(
String host, String protocol) {
String propNameHost = "proxyHost";
String propNamePort = "proxyPort";

String proxyHost =
System.getProperty(protocol+"."+propNameHost);
Integer proxyPortInt =
Integer.getInteger(protocol+"."+propNameHost);

if(proxyHost == null && proxyPortInt == null) {
// Fall back if the properties do not exist.
proxyHost = System.getProperty(propNameHost);
proxyPortInt = Integer.getInteger(propNamePort);
}

HostConfiguration config = new HostConfiguration();
config.setHost(host, -1, protocol); // Use default port.

if (proxyHost != null && proxyPortInt != null) {
int proxyPort = proxyPortInt.intValue();
config.setProxy(proxyHost, proxyPort);
}

return config;
}

And is it needed to make a HostConfiguration by hand?
Can't I just do:
HttpClient hc = new HttpClient();
hc.executeMethod("http://bla1.bla/bla/bla";);
hc.executeMethod("http://bla2.bla/bla/bla";);
hc.executeMethod("http://bla3.bla/bla/bla";);

And that the HostConfiguration is used internaly in HttpClient in stead of made by me.
I now have to do the bookkeeping of all the hosts I connect with myself and it would be nice if that is all handled automaticly by httpClient.
Just my to cents.

I'm willing to write some code for this, but I don't wont to change the API, if other developers don't agree with it.

Greetings,

Ronald.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to