~emersion/soju

85fad93a71e317ceef5f11623bca40deeaf26240 — Simon Ser 1 year, 2 months ago 7af21d9
Add support for upstream Unix socket connections

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

M doc/soju.1.scd
M upstream.go
M doc/soju.1.scd => doc/soju.1.scd +3 -2
@@ 116,8 116,9 @@ abbreviated form, for instance *network* can be abbreviated as *net* or just

	_addr_ supports several connection types:

	- _[ircs://]host[:port]_ connects with TLS over TCP
	- _irc+insecure://host[:port]_ connects with plain-text TCP
	- _[ircs://]<host>[:port]_ connects with TLS over TCP
	- _irc+insecure://<host>[:port]_ connects with plain-text TCP
	- _unix:///<path>_ connects to a Unix socket

	Other options are:


M upstream.go => upstream.go +6 -0
@@ 142,6 142,12 @@ func connectToUpstream(network *network) (*upstreamConn, error) {
		if err != nil {
			return nil, fmt.Errorf("failed to dial %q: %v", addr, err)
		}
	case "unix":
		logger.Printf("connecting to Unix socket at path %q", u.Path)
		netConn, err = dialer.Dial("unix", u.Path)
		if err != nil {
			return nil, fmt.Errorf("failed to connect to Unix socket %q: %v", u.Path, err)
		}
	default:
		return nil, fmt.Errorf("failed to dial %q: unknown scheme: %v", network.Addr, u.Scheme)
	}