0

I am calling a number of apis of a web service hosted on a number of servers. Requests get routed to these servers at random through a load balancer. All these servers reside on my local network and I want one particular api call to go to one particular server. Since I don't want other requests to get affected, I am unwilling to put a host entry on the server hosting my app. Can this be achieved through code? I am coding in ruby and using net-http gem to make api calls. Any implementation using curb gem is also welcome.

Thanks

-Azitabh

azi
  • 929
  • 1
  • 11
  • 31

2 Answers2

0

I think the best way to achieve what you want is to use a proxy with DNS Spoofing.

Charles proxy does that but there might be other tools also.

systho
  • 1,161
  • 7
  • 17
  • This I guess will direct all requests to that domain name to the configured ip. What I want is a particular api call to go to a particular ip. Everything else should remain unperturbed. – azi Dec 23 '12 at 15:51
0

One way(on the same lines as suggested by systho) I can think of is to make the api call directly using the IP and create a vhost on the server which is listening directly on a separate port.

This will work for me purely because of the fact that I have access to the servers hosting the web service.

azi
  • 929
  • 1
  • 11
  • 31