Skip to content

Support socket activation with launchd and systemd #58

Description

@reegnz

This would allow shell2http to be used with inetd-like scenarios, eg. Systemd Socket activation, or Launchd socket activation.

This is especially useful if you want your application to bind to a privileged port (eg. 80), but don't want the application to run as root, but also don't want to set up a separate proxy process to proxy 80 -> 8080.

So in that case you would have a managing process (like launchd, systemd) open the socket on the privileged port and have it passed to the process instead.

Launchd:
https://en.wikipedia.org/wiki/Launchd#Socket_activation_protocol
https://github.com/sstephenson/launch_socket_server/blob/master/src/launch_socket_server.go

Systemd:
http://0pointer.de/blog/projects/socket-activation.html
https://www.darkcoding.net/software/systemd-socket-activation-in-go/
https://github.com/coreos/go-systemd/tree/master/examples/activation/httpserver

I am open to doing a PR if you would find the idea compatible with shell2http.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions