Re: specifying a network interface, with a http get request



Hey John,

Thanks for your response, however I think you misunderstood my post. I'm
looking for a way to bind to a specific IP for outgoing requests. That
is on the server i want to use something like the following sudo code:

def getPage(whichIP)
ip = '';
case (whichIP)
when 0: ip = '123.456.789.001';
when 1: ip = '123.456.789.002';
when 2: ip = '123.456.789.003';
default: ip = '123.456.789.004';
end

soc = bind(ip,80); #bind to specific ip and port 80

soc.open(myUrl) do |sh|
return sh.read();
end
end


now if the url was for a page that had no content, except for the IP
address of the requester then the following code:

puts getPage(0);
puts getPage(1);
puts getPage(2);
puts getPage(3);

would output:
123.456.789.001
123.456.789.002
123.456.789.003
123.456.789.004

Hope that makes it clearer

Andy
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages