mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-05 03:34:41 +08:00
core: Support Windows absolute paths for UDS proxy upstreams (#5114)
* added some tests for parseUpstreamDialAddress Test 4 fails because it produces "[[::1]]:80" instead of "[::1]:80" * support absolute windows path in unix reverse proxy address * make IsUnixNetwork public, support +h2c and reuse it * add new tests
This commit is contained in:
@ -34,7 +34,7 @@ import (
|
||||
// reuseUnixSocket copies and reuses the unix domain socket (UDS) if we already
|
||||
// have it open; if not, unlink it so we can have it. No-op if not a unix network.
|
||||
func reuseUnixSocket(network, addr string) (any, error) {
|
||||
if !isUnixNetwork(network) {
|
||||
if !IsUnixNetwork(network) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ func listenTCPOrUnix(ctx context.Context, lnKey string, network, address string,
|
||||
|
||||
// reusePort sets SO_REUSEPORT. Ineffective for unix sockets.
|
||||
func reusePort(network, address string, conn syscall.RawConn) error {
|
||||
if isUnixNetwork(network) {
|
||||
if IsUnixNetwork(network) {
|
||||
return nil
|
||||
}
|
||||
return conn.Control(func(descriptor uintptr) {
|
||||
|
Reference in New Issue
Block a user