简体   繁体   中英

Rails remote_ip always 127.0.0.2

I am using rails 3. I want to get client ip. I am using this method: request.remote_ip and always getting 127.0.0.2. Why ? ( also tested on TorProject)

It would depend where you're testing from. If it's in production and you're trying this off of an external computer(that's not on the same network as the server) it should work. Otherwise yes, it should be some sort of proxy or gateway translating the address.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM