Skip to content

Instantly share code, notes, and snippets.

@dtmrc
Forked from minhoryang/README.md
Created September 15, 2021 18:57
Show Gist options
  • Save dtmrc/7df7013085d2c1ea7330e03bf1ec9d56 to your computer and use it in GitHub Desktop.
Save dtmrc/7df7013085d2c1ea7330e03bf1ec9d56 to your computer and use it in GitHub Desktop.
FLASK with UDS(Unix Domain Socket)
# https://palletsprojects.com/p/flask/
from flask import Flask, escape, request
app = Flask(__name__)
@app.route('/')
def hello():
name = request.args.get("name", "World")
return f'Hello, {escape(name)}!'
Flask==1.1.1
Werkzeug==0.15.5
socat TCP-LISTEN:12346 UNIX-CONNECT:/tmp/test &
FLASK_APP=app.py flask run --host=unix:///tmp/test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment