You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by "Niti Bhatt (PL/EUS)" <ni...@ericsson.com> on 2007/04/03 23:46:09 UTC

Getting proxy information with HttpClient

Hi Community,
    I have an application that sends audio data over HTTP as a file
object using HttpClient and PostMethod. For my corporate office, I know
the proxy host and port configuration which I am setting using
httpclient.getHostConfiguration().setProxyHost(proxy_host, proxy_port).
Assuming that all the corporate offices will be behind a firewall, I am
wondering if there is a way to make the application run from other
corporate offices, meaning how can I read the proxy information of the
client if the client is sitting in any corporate enviornment. 

Is there a way to implement this with HttpClient?

Any help would be highly appreciated..

Thanks/Niti

Re: Getting proxy information with HttpClient

Posted by Roland Weber <os...@dubioso.net>.
Hello Niti,

> BTW, is it
> necessary to know which Proxy I am behind, like SOCKS or ??.

As long as everything works, you don't need to care. But since
it's not working for you, you need to go into the details. Yes,
there is a big difference between SOCKS and HTTP proxies. An
HTTP proxy needs to be configured in HttpClient, while a SOCKS
host needs to be configured in the JVM, since it's Java code
that opens the SOCKS connection. Unless you are using a different
library for opening the SOCKS connection. Now if you're going
through an HTTP proxy and you know that this proxy should be
connected directly rather than through SOCKS, although SOCKS
is configured in the JVM...  you get the picture, don't you?

cheers,
  Roland

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


RE: Getting proxy information with HttpClient

Posted by "Niti Bhatt (PL/EUS)" <ni...@ericsson.com>.
Thanks Roland,
     I will try to use ProxySelector to see if that works. BTW, is it
necessary to know which Proxy I am behind, like SOCKS or ??. I am quite
new to using proxies and so am not very sure about it.

BR/Niti 

-----Original Message-----
From: Roland Weber [mailto:ROLWEBER@de.ibm.com] 
Sent: Wednesday, April 04, 2007 12:22 AM
To: HttpClient User Discussion
Subject: Re: Getting proxy information with HttpClient

Hello Niti,

have a look at the application design FAQ:
http://wiki.apache.org/jakarta-httpclient/FrequentlyAskedApplicationDesi
gnQuestions

cheers,
  Roland


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


Re: Getting proxy information with HttpClient

Posted by Roland Weber <RO...@de.ibm.com>.
Hello Niti,

have a look at the application design FAQ:
http://wiki.apache.org/jakarta-httpclient/FrequentlyAskedApplicationDesignQuestions

cheers,
  Roland