Search code examples
serverip-addresswebservice-client

Setup a server that can detect IP addresses of clients


I am trying to set up what is possibly a webserver that can detect the IP addresses of the clients that try to access the webpage. In the simplest terms.

1)Let there be a table on the website.

2)Each time a client requests the website, its IP address gets added to the entry of the table.

I have made a webserver before using apache tomcat and even nodejs. But I have no idea how to detect IP adresses. I would also like to know if its possible to set this up online, in the cheapest possible way.


Solution

  • Perhaps nodejs would work using request.connection.remoteAddress, as in this example.