~emersion/soju-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Add unix domain socket listeners for HTTP and WS

Details
Message ID
<20240414025447.8572-1-egor@opensrc.club>
DKIM signature
missing
Download raw message
Patch: +24 -0
---
 cmd/soju/main.go | 20 ++++++++++++++++++++
 doc/soju.1.scd   |  4 ++++
 2 files changed, 24 insertions(+)

diff --git a/cmd/soju/main.go b/cmd/soju/main.go
index 04de78b..9f254e2 100644
--- a/cmd/soju/main.go
+++ b/cmd/soju/main.go
@@ -275,6 +275,16 @@ func main() {
					log.Fatalf("serving %q: %v", listen, err)
				}
			}()
		case "ws+unix":
			ln, err := net.Listen("unix", u.Path)
			if err != nil {
				log.Fatalf("failed to start listener on %q: %v", listen, err)
			}
			go func() {
				if err := http.Serve(ln, srv); err != nil {
					log.Fatalf("serving %q: %v", listen, err)
				}
			}()
		case "ident":
			if srv.Identd == nil {
				srv.Identd = identd.New()
@@ -366,6 +376,16 @@ func main() {
					log.Fatalf("serving %q: %v", listen, err)
				}
			}()
		case "http+unix":
			ln, err := net.Listen("unix", u.Path)
			if err != nil {
				log.Fatalf("failed to start listener on %q: %v", listen, err)
			}
			go func() {
				if err := http.Serve(ln, httpMux); err != nil {
					log.Fatalf("serving %q: %v", listen, err)
				}
			}()
		default:
			log.Fatalf("failed to listen on %q: unsupported scheme", listen)
		}
diff --git a/doc/soju.1.scd b/doc/soju.1.scd
index 26827d2..f06d5f8 100644
--- a/doc/soju.1.scd
+++ b/doc/soju.1.scd
@@ -92,10 +92,14 @@ The following directives are supported:
	  and handles WebSocket requests at endpoint _/socket_
	- _http+insecure://[host][:port]_ listens for plain-text HTTP connections
	  (default port: 80) and handles WebSocket requests at endpoint _/socket_
	- _http+unix://<path>_ listens for plain-text HTTP connections on a Unix
	  domain socket and handles WebSocket requests at endpoint _/socket_
	- _wss://[host][:port]_ listens for WebSocket connections over TLS (default
	  port: 443)
	- _ws+insecure://[host][:port]_ listens for plain-text WebSocket
	  connections (default port: 80)
	- _ws+unix://<path>_ listens for plain-text WebSocket connections on a Unix
	  domain socket
	- _ident://[host][:port]_ listens for plain-text ident connections (default
	  port: 113)
	- _http+prometheus://localhost:<port>_ listens for plain-text HTTP
-- 
2.39.2
Details
Message ID
<ORngTT1Sfgxqe2QVbYnMrN3Ve7TaeKU_AmvhNkGkuh2Bom84bveScRKYLHqu_M0tlXOcQpv_XII6_Ba_QyFSFBTP38LXRbkQkYQ0JPzsmLI=@emersion.fr>
In-Reply-To
<20240414025447.8572-1-egor@opensrc.club> (view parent)
DKIM signature
pass
Download raw message
Pushed, thanks!
Reply to thread Export thread (mbox)