![]() ![]() ![]() ![]() Implementing this in Datasetteĭatasette uses the excellent Uvicorn Python web server to serve traffic out of the box, and Uvicorn already includes support for UDS-so adding support to Datasette was pretty easy-here’s the full implementation. It turns out both nginx and Apache have the ability to proxy traffic to a Unix domain socket rather than to an HTTP port, which makes this a useful mechanism for running backend servers without attaching them to TCP ports. Plenty more examples in the Docker documentation if you click the ’HTTP’ tab. I’ve encountered these before with the Docker daemon, which listens on path /var/run/docker.sock and can be communicated with using curl like so: curl -unix-socket /var/run/docker.sock \ Unix domain sockets provide a mechanism whereby different processes on a machine can communicate with each over over a mechanism similar to TCP, but via a file path instead. I’ve not worked with these much before so it was a good opportunity to learn something new. This started out as a feature request from Aslak Raanes: #1388: Serve using UNIX domain socket. A small enhancement to Datasette this week: I’ve added support for proxying via Unix domain sockets. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |