Ask coding questions

← Back to all posts
How to get IP address of user?
h
Glitchez

Hey,
I am making a chat application and am currently working on a moderator role. I am trying to find the users IP and if it matches a blacklisted IP the user gets kicked. I figured out how to kick users, but I can't get their IP no matter what I try. I need this for non-malicious purposes so if anybody knows another identifier for this it would be great. but my question is how to get the IP address of my user?

Answered by SixBeeps [earned 5 cycles]
View Answer
Voters
Glitchez
Comments
hotnewtop
SixBeeps

Replit masks the ability to get a requester's IP. Sorry.

BasToTheMax

@SixBeeps but you could get the IP client side and then send the IP to the server

SixBeeps

@BasToTheMax That defeats the purpose. Pretty sure obtaining someone's IP breaks Replits TOS/Privacy Policy.

Glitchez

@SixBeeps I am not necessarily going to run this exclusively on replit. I mean I would prefer but I will also run this on my apache2 web-server.