Bind to unix domain socket instead of ip address
See original GitHub issueWhen running applications like uvicorn behind a reverse proxy like NGINX it is best practice to use a unix domain socket instead of binding to an ip address. This has the benefit of improved security and performance.
This could be implemented the same way as gunicorn does it. If the bind parameter starts with unix:
, use a unix domain socket. One caveat is that the socket file will have to be created beforehand and cleaned up afterwards.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
UNIX domain sockets - IBM
Unlike internet sockets in the AF_INET domain where the socket is bound to a unique IP address and port number, a UNIX domain...
Read more >What is the difference between Unix sockets and TCP/IP ...
UNIX domain sockets know that they're executing on the same system, so they can avoid some checks and operations (like routing); which makes...
Read more >Is there any purpose to `bind()` unix domain socket client ...
When a socket is created with socket(2), it exists in a name space (address family) but has no address assigned to it. bind()...
Read more >What is non-networked Unix domain socket? - Super User
(However, the actual API is almost identical between IP and Unix sockets – programs use the same socket(), bind(), connect() calls for both ......
Read more >Unix Domain Socket bind, reuse address
I would test your assertion regarding unlink() From memory, its the inode not the file path which is technically listened to. · You...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Documented this better under 0.2. - http://www.uvicorn.org/#running-with-gunicorn
Also things are more properly split out now - the standard command line tool doesn’t depend on gunicorn, but we include a gunicorn worker class, and document using that, as well as running the cli for simpler style.
Note: We do need to document this. We currently don’t have any proper documentation about the available command line arguments.