Re: specifying a network interface, with a http get request
- From: Andrew Parlane <ajp97@xxxxxxxxx>
- Date: Fri, 29 Aug 2008 04:26:18 -0500
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/.
.
- Follow-Ups:
- Re: specifying a network interface, with a http get request
- From: Lex Williams
- Re: specifying a network interface, with a http get request
- Prev by Date: Re: Please don't flame me...why is there no "++" in Ruby again ?
- Next by Date: Re: specifying a network interface, with a http get request
- Previous by thread: how can I debug treetop grammar?
- Next by thread: Re: specifying a network interface, with a http get request
- Index(es):
Relevant Pages
|