[ 작업환경 ]

Centos 7

Flask 1.1

Python 3.6

 

# vim app/routes.py

from flask import request

# ...

# get client's ip test
@app.route('/ip', methods=['GET'])
def client_ip():
    return request.environ.get('HTTP_X_REAL_IP', request.remote_addr)

 

 

 

결과 화면 예시

 

 

+ Recent posts