Created
March 29, 2017 02:45
-
-
Save helushune/8a8fa7faaa85b3b225012d02148ab4dd to your computer and use it in GitHub Desktop.
Quick Bottle app for pfsense acceptable IP check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import Bottle, request, error, run | |
app = Bottle() | |
@app.route('/') | |
def hello(): | |
client_ip = request.environ.get('HTTP_X_FORWARDED_FOR') | |
return ['Current IP Address: {}\n'.format(client_ip)] | |
app.run(host='127.0.0.1', port=8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment