I am using Rails 5 with ruby 2.4 I am using TCP server for the TCP api communication. I am able to find the Ip address from which the request is getting generated like:
require 'socket'
server = TCPServer.new 53492 # Server bound to port 53492
loop do
Thread.start(server.accept) do |client|
p "Client peer address = #{client.peeraddr[3]}"
end
end
Can I get the country form which the request client is using the Api.