From: Martin Boese Date: 2008-03-30T17:08:55+09:00 Subject: Re: remote ip address The remote ip is a CGI parameters. All webservers should set this, you can read it with (assuming you use CGI): require 'cgi' $stderr.puts "Remote Addr: #{CGI.new.remote_addr}" Martin On Sunday 30 March 2008 00:51:25 Ben Aroia wrote: > Iñaki Baz Castillo wrote: > > El Domingo, 30 de Marzo de 2008, Ben Aroia escribió: > >> I am going to be using a simple ip limiting system on a site I'm working > >> on and using php you can get the remote ip simply by calling something > >> like > >> > >> Is there a similar method in ruby? I am not using rails, not supported > >> on the server I'm using. Thanks > > > > That depends on the Ruby web server you are using. The source IP is > > obtained > > from the connection Ruby socket (if Ruby handles the conecction) but if > > you > > are using a web server that is the responsible of handling the TCP > > connection > > and providing the origin address:port in form of variable and so. > > Apache/1.3.34 Ben-SSL/1.55 is the server info. It goes index.php has a > form that is submitted using GET to /ruby.rb. ruby.rb generates the > content for the page depending on the form input. I'm not sure if I'm > all that clear. It's not a ruby web server. It's just a script on a web > server.