java - Send multiple httpRequest by different proxies -


i using httpclient fluent api version 4.3.2 send multiple request various addresses defined user. each address use particular proxy setting. below current code:

try {              final executor executor = executor.newinstance().auth(proxy, username, password);             system.out.println(executor.execute(request.get(uri).viaproxy(proxy)).returnresponse().getstatusline());         } catch (final exception e) {              e.printstacktrace();          } 

i facing problem, when connect address 1 proxy 1 (correct value of proxy username , proxy password), request send expected.

but when add address 2 proxy 1 (wrong value of proxy username , proxy password), expectation request fail, still connect successfully.

i though after send request through proxy, first proxy setting cached somewhere in jvm, , can not set proxy setting request.

is there solution this?

trying setting proxy prior request execution

executor executor = executor.newinstance().auth(proxy, username, password); system.out.println(executor   .viaproxy(proxy)   .execute(request.get(uri))   .returnresponse().getstatusline()); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -