I have a Flask App running on Glitch. I want to find a way to get the IP address of the client who is requesting data from my website. Is there a way to do that? And before you mark this question as a duplicate, I tried request.environ['REMOTE_ADDR']
, request.environ.get('HTTP_X_REAL_IP', request.remote_addr)
, request.remote_addr
, and so many more. All of those show 127.0.0.1, which is the server's IP Address. I am looking for a specific way on Glitch. Any help would be appreciated. Thanks in advance!
Code:
# Imports
app = Flask(__name__)
@app.route("/")
def index():
# Stuff
if __name__ == "__main__":
app.run()
I don't why
remote_addr
didn't work, did you use it this way: