# File lib/rack/request.rb, line 256
256:     def ip
257:       if addr = @env['HTTP_X_FORWARDED_FOR']
258:         (addr.split(',').grep(/\d\./).first || @env['REMOTE_ADDR']).to_s.strip
259:       else
260:         @env['REMOTE_ADDR']
261:       end
262:     end