~emersion/soju

061347f9f91fdd80dd2e8819a4dec98a90eda7e5 — Simon Ser 6 months ago 67fb669
Add Unix socket listener

Closes: https://todo.sr.ht/~emersion/soju/51
2 files changed, 12 insertions(+), 0 deletions(-)

M cmd/soju/main.go
M doc/soju.1.scd
M cmd/soju/main.go => cmd/soju/main.go +11 -0
@@ 114,6 114,17 @@ func main() {
					log.Printf("serving %q: %v", listen, err)
				}
			}()
		case "unix":
			ln, err := net.Listen("unix", u.Path)
			if err != nil {
				log.Fatalf("failed to start listener on %q: %v", listen, err)
			}
			ln = proxyProtoListener(ln, srv)
			go func() {
				if err := srv.Serve(ln); err != nil {
					log.Printf("serving %q: %v", listen, err)
				}
			}()
		case "wss":
			addr := u.Host
			if _, _, err := net.SplitHostPort(addr); err != nil {

M doc/soju.1.scd => doc/soju.1.scd +1 -0
@@ 82,6 82,7 @@ The following directives are supported:
	  omitted: 6697)
	- _irc+insecure://[host][:port]_ listens with plain-text over TCP (default
	  port if omitted: 6667)
	- _unix:///<path>_ listens on a Unix domain socket
	- _wss://[host][:port]_ listens for WebSocket connections over TLS (default
	  port: 443)
	- _ws+insecure://[host][:port]_ listens for plain-text WebSocket