pallets / quart

An async Python micro framework for building web applications.
https://quart.palletsprojects.com
MIT License
2.92k stars 159 forks source link

unix socket support #327

Closed kone-tlammi closed 6 months ago

kone-tlammi commented 6 months ago

Support for binding Quart to unix sockets without appending port.

This already somewhat works

import quart
app = quart.Quart("foo")
@app.route("/")
def hello():
    return "hello\n"

app.run("unix:///tmp/bar.sock")

but the port number is appended to the socket name so the server will listen in /tmp/bar.sock:5000:

$ curl --unix-socket /tmp/bar.sock\:5000 http://_/
hello
pgjones commented 6 months ago

Use Hypercorn directly for this, see docs