Reputation: 18353
I'm going to request some IIS web server through (for instance) WebClient for some website. IIS has two (or more) instances and load balancer decides which will be used for handling the request. Usually if the connection is established the particular server is assigned to response further requests. Is there any way to force load balancer to connect with different server? Is there any method of any class in .NET to do it or at least to determine which web server is responding?
I'm asking because I need to connect to all of the servers behind the load balancer and check downloaded content.
Upvotes: 2
Views: 4006
Reputation: 3973
There are two ways.
One example of a Web Proxy is: https://nordvpn.com/web-proxy/
To help in debugging I try to make a point of putting something unique on each server so that I know which one I am hitting. This might be a small clue in a page footer or something similar.
Upvotes: 0
Reputation: 36327
No, since the load balancer has to decide before your code even had a chance of being executed on the web server.
It would be pretty hazardous if an outsider could influence the choice of the load balancer; DoS attacks would be much easier.
Upvotes: 1