Dinamically switching response ip address(c#)
I am trying to make a small script in ASP.NET(C#) that interface with external RESTapi service,
the problem is that i want the script to switch response ip address after 10(for example) requests,
i bought 12 static IP addresses to my server and binded all of them to the network card and to the iis application.
i searched all over the internet and didnt found even a small example of how to do this, is it possible at all?
the script should look like this(only for example):
string[] ips = {"1.1.1.1","2.2.2.2","3.3.3.3",....}; int i = 0,sel=0; foreach(var request in requests) { if(i % 10 == 0) sel ++; if(sel == ips.length) sel = 0; doREST(request,ips[sel]); i++; } Another idea
i Thought about another idea, maybe its better to do a request to my server himself, for example from:
example.com/edit/post/12
to:
1.1.1.1/do-rest/12
and than to:
2.2.2.2/do-rest/12
the problem with this is that it could be high amount of request inside the server on high traffic.
Thanks!