On Thu, 2014-10-23 at 15:07 +0800, 风 wrote:
> hi All:
> i want to config the ip of the request, how to do?
>
>
> for example:
> HttpGet httpGet = new HttpGet("https://www.google.com/");
> httpClient.execute(httpGet);
>
>
> in this way, httpClient will config the google's ip autoly. but i want to
> config the google's ip in my self.
> i want httpclient to visit google in the ip: 2.2.2.2. how to do?
>
HttpHost target = new HttpHost(
InetAddress.getByAddress(new byte[] {2,2,2,2}), 443, "https");
HttpGet httpGet = new HttpGet("https://www.google.com/");
httpClient.execute(target, httpGet);
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]