Skip to content

Instantly share code, notes, and snippets.

@helushune
Created March 29, 2017 02:45
Show Gist options
  • Save helushune/8a8fa7faaa85b3b225012d02148ab4dd to your computer and use it in GitHub Desktop.
Save helushune/8a8fa7faaa85b3b225012d02148ab4dd to your computer and use it in GitHub Desktop.
Quick Bottle app for pfsense acceptable IP check
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