From ddfa723f778a55fbb943c3675bf43280788d8832 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sun, 24 Sep 2023 12:04:55 -0700 Subject: [PATCH] Update service socket docs --- docs/Formula-Cookbook.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md index 45cd6b5c7e..05ea59c9dd 100644 --- a/docs/Formula-Cookbook.md +++ b/docs/Formula-Cookbook.md @@ -1052,6 +1052,24 @@ The `sockets` method accepts a formatted socket definition as `://:< Please note that sockets will be accessible on IPv4 and IPv6 addresses by default. +If you only need one socket and you don't care about the name (the default is `Listeners`): + +```rb +service do + run [opt_bin/"beanstalkd", "test"] + sockets "tcp://127.0.0.1:80" +end +``` + +If you need multiple sockets and/or you want to specify the name: + +```rb +service do + run [opt_bin/"beanstalkd", "test"] + sockets "Socket" => "tcp://0.0.0.0:80", "SocketTLS" => "tcp://0.0.0.0:443" +end +``` + ### Using environment variables Homebrew has multiple levels of environment variable filtering which affects which variables are available to formulae.