Add support for upstream Unix socket connections
References: https://todo.sr.ht/~emersion/soju/51
This commit is contained in:
parent
7af21d9d81
commit
85fad93a71
@ -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:
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user