Get own IP address
Try:
require 'socket'
ip=Socket.ip_address_list.detect{|intf| intf.ipv4_private?}
ip.ip_address if ip
I believe request.env['SERVER_NAME']
works, if you want to reflect the server base address back
Try:
require 'socket'
ip=Socket.ip_address_list.detect{|intf| intf.ipv4_private?}
ip.ip_address if ip
I believe request.env['SERVER_NAME']
works, if you want to reflect the server base address back