plack / Plack

PSGI toolkit and server adapters
http://plackperl.org/
Other
486 stars 214 forks source link

Please support `--listen /some/unix.sock` on HTTP #672

Open leonerd opened 2 years ago

leonerd commented 2 years ago

When running a FastCGI responder, we can simply

$ plackup -s FCGI --listen /some/path/to/unix.sock

to have it listen on a UNIX socket. The same is not true for the HTTP version:

$ plackup --listen /some/path/to/unix.sock
HTTP::Server::PSGI: Accepting connections at http://0:8080/

This then ends up binding to TCP port 8080, and not the UNIX path.

It'd be great to be able to support UNIX-hosted HTTP responders on fixed paths.

skaji commented 2 years ago

You may want to look at other PSGI servers, such as Starlet:

❯ plackup -s Starlet --listen unix.sock  -e 'sub { [200, [], ["ok"]] }'
Plack::Handler::Starlet: Accepting connections at http://0:unix.sock/
leonerd commented 2 years ago

Also while there, don't forget to additionally account for chmod, the same issue as https://github.com/miyagawa/Starman/issues/145