We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1a89b1 commit 76dd050Copy full SHA for 76dd050
app.py
@@ -5,11 +5,24 @@
5
6
@app.route('/')
7
def ip(): # put application's code here
8
- if flask.request.remote_addr == '127.0.0.1':
+ if flask.request.environ.get('HTTP_X_REAL_IP') is not None:
9
IP = flask.request.environ.get('HTTP_X_REAL_IP', flask.request.remote_addr)
10
else:
11
IP = flask.request.remote_addr
12
- return IP
+ return f"""<title>Your IP is {IP}</title><h1
13
+ id="age"
14
+ style="
15
+ font-size: 32px;
16
+ font-size: 3vw;
17
+ height: 100%;
18
+ width: 100%;
19
+ display: flex;
20
+ position: fixed;
21
+ align-items: center;
22
+ justify-content: center;
23
+ "
24
+ >Your public IP is {IP}
25
+ </h1>"""
26
27
28
if __name__ == '__main__':
0 commit comments