Ask coding questions

← Back to all posts
Flask
YuChuehWang

My Goal:Get Client IP using flask

I am writing an Flask project and would like to get client(remote) IP and i try the following and it all doesn't work. can any one help me please!

I tried this:

which only gives me the server IP

I also try this

which still only give me the server IP adress

I then try these:

which give me a different result(gives me the server network IP instead), but still didn't give me the real IP!

is this due to the limitation of repl? or is there other solution?

PLEASE HELP!!!

Voters
YuChuehWang
Comments
hotnewtop
RoBlockHead

You are not able to get client IPs using Replit. If you want to use client IPs you need to use a different service.

YuChuehWang

@RoBlockHead thank you for answering but can I understand what exactly happened in the back-end/what mechanism that disallowed my ability to know the client IP?

RoBlockHead

@YuChuehWang Replit blocks client IPs from being visible because you aren't allowed to use them on replit.