hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Best way to deal with proxy servers from simple applet?
Date Mon, 23 Feb 2009 23:02:12 GMT
Scott Mueller wrote:
> Thanks Oleg.  Ok, so basically all normal applets should have your code
> below.  Setting the route planner to ProxySelectorRoutePlanner works the
> same as not setting it at all if the browser has no proxy settings right?
> 

Yes, it should.

Oleg

> On Sun, Feb 22, 2009 at 8:09 AM, Oleg Kalnichevski <olegk@apache.org> wrote:
> 
>> Scott Mueller wrote:
>>
>>> Hi guys, I have a simple applet which is given a set of local files to
>>> upload to my server using HttpClient and MultipartEntity.  Basically when
>>> someone uploads a GEDCOM file (genealogy data), the images are specified
>>> as
>>> local files.  So I then present a signed applet to them to grab those
>>> files
>>> off their local filesystem.  This is the least intrusive and simplest way
>>> I
>>> could think of to get these images from users.
>>>
>>> So what do I do about proxy servers?  Is there a way I can read from the
>>> browser if and how their proxy configuration is setup and then transfer
>>> that
>>> information to HttpClient in the applet?  Is it possible HttpClient does
>>> this automatically?
>>>
>> Yes, it can. Configure HttpClient to use ProxySelectorRoutePlanner instead
>> of the DefaultHttpRoutePlanner.
>>
>> ---
>> DefaultHttpClient httpclient = new DefaultHttpClient();
>>
>> ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
>>        httpclient.getConnectionManager().getSchemeRegistry(),
>>        ProxySelector.getDefault());
>>
>> httpclient.setRoutePlanner(routePlanner);
>> ---
>>
>> Oleg
>>
>>
>>  Are there standard system properties I can read to deal
>>
>>> with this?  Are there any other situations I should be aware of, like
>>> proxy
>>> servers, that might prevent images from being uploaded?
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message