c# - Change originating IP - circumventing caching of connections -


i need call same api many times, different ip's based on parameters.

i've implemented code in question: how change originating ip in httpwebrequest

this worked when needed specify single ip api calling, need use several ips based on requirements, , method no longer seems work. api url seems cached , subsequent calls use ip, instead of specific 1 wish set on every call.

i need method let me choose source ip each request.

adding:

if split application 2 separate apps, each 1 using own source ip, brute force approach force work? in other words, caching performed per process? (i assume so).

using httpwebrequest.connectiongroupname should able around servicepoint connection reuse.

var hr = (httpwebrequest)webrequest.create("http://google.com?"); hr.connectiongroupname = hr.requesturi.tostring(); //different connection pool per url. might better make random. hr.getresponse(); 

alternatively can force close group using servicepoint.closeconnectiongroup. default group null.

var hr = (httpwebrequest)webrequest.create("http://google.com"); hr.servicepoint.closeconnectiongroup(null); hr.getresponse(); 

Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -