Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 54264 invoked from network); 9 Oct 2008 04:08:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Oct 2008 04:08:45 -0000 Received: (qmail 92547 invoked by uid 500); 9 Oct 2008 04:08:43 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 92525 invoked by uid 500); 9 Oct 2008 04:08:43 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 92514 invoked by uid 99); 9 Oct 2008 04:08:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2008 21:08:43 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_SECURITYSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stevezau@gmail.com designates 209.85.198.248 as permitted sender) Received: from [209.85.198.248] (HELO rv-out-0708.google.com) (209.85.198.248) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2008 04:07:39 +0000 Received: by rv-out-0708.google.com with SMTP id l33so4304122rvb.58 for ; Wed, 08 Oct 2008 21:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=yVv1PGN7C/gq+R38uHH7RXsJWG1PVkZ59O2mPomyTok=; b=scx/AoHFjC1qAAVBH/9o0nytN4UaxKZKMK1BbBK9VPQh8/cOl5X1JDX5pjzKAL7rUT FtC/1ff5hQFi1XvpWCYD1JNu3ngLfhiA4X9uzesUnqQ8uLKtuVthgxVPyxLm6GPowR/4 CDLfXsi6OoySc82HB9mSQay8iOPAIz6YgV1lM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Q0zC5/klOa6TkO0dIrwo7z5mHoZreRiTDh3LJid7kd2SXg1RPSj9JkXR4qpSZUT97L LyscMS/UtcCTzOJHoSpMkBODVUmO69CXJIQ1FLECW9HeBmZHfBCGxpxUf4/DYYKPGgFY LLByDvBY/22WVsW1gd1MwfJAwpAvf3jolsi5s= Received: by 10.141.5.17 with SMTP id h17mr5769920rvi.8.1223525295546; Wed, 08 Oct 2008 21:08:15 -0700 (PDT) Received: from ?192.168.0.2? (220-244-14-150.static.tpgi.com.au [220.244.14.150]) by mx.google.com with ESMTPS id b39sm33540662rvf.0.2008.10.08.21.08.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Oct 2008 21:08:14 -0700 (PDT) Message-ID: <48ED83A0.6050708@gmail.com> Date: Thu, 09 Oct 2008 15:08:00 +1100 From: Steven Adams User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: HttpClient User Discussion Subject: Re: Force httpclient to use an alt IP References: <48EB02AF.7040505@gmail.com> <1223388181.6150.31.camel@ubuntu> In-Reply-To: <1223388181.6150.31.camel@ubuntu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Ahh.. Thanks Oleg. Oleg Kalnichevski wrote: > On Tue, 2008-10-07 at 17:33 +1100, Steven Adams wrote: > >> Hi All, >> >> I have several IP's on the server I'm using HttpClient 4. >> >> I would like to force httpclient to use one of the other IP's, can >> someone please tell me if this is possible and how? >> >> Thanks >> Steve >> >> > > Set 'http.route.local-address' parameter to the desired local address > either on the client or request level: > > --- > DefaultHttpClient httpclient = new DefaultHttpClient(params); > > httpclient.getParams().setParameter( > ConnRouteParams.LOCAL_ADDRESS, Inet4Address.getLocalHost()); > > HttpGet httpget = new HttpGet("http://localhost:8080"); > httpget.getParams().setParameter( > ConnRouteParams.LOCAL_ADDRESS, Inet4Address.getLocalHost()); > > HttpResponse response = httpclient.execute(httpget); > --- > > Hope this helps > > Oleg > > > >> --------------------------------------------------------------------- >> 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org