mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 15:53:17 +00:00
use the network and address from the dialInfo if there is no proxy or the upstream network is unix
This commit is contained in:
parent
ed4281ff57
commit
740ff2cef8
1 changed files with 1 additions and 1 deletions
|
@ -276,7 +276,7 @@ func (h *HTTPTransport) NewTransport(caddyCtx caddy.Context) (*http.Transport, e
|
||||||
// This means we can safely use the address in dialInfo if proxy is not used (the address and network will be same any way)
|
// This means we can safely use the address in dialInfo if proxy is not used (the address and network will be same any way)
|
||||||
// or if the upstream is unix (because there is no way socks or http proxy can be used for unix address).
|
// or if the upstream is unix (because there is no way socks or http proxy can be used for unix address).
|
||||||
if dialInfo, ok := GetDialInfo(ctx); ok {
|
if dialInfo, ok := GetDialInfo(ctx); ok {
|
||||||
if strings.HasPrefix(dialInfo.Network, "unix") {
|
if caddyhttp.GetVar(ctx, proxyVarKey) == nil || strings.HasPrefix(dialInfo.Network, "unix") {
|
||||||
network = dialInfo.Network
|
network = dialInfo.Network
|
||||||
address = dialInfo.Address
|
address = dialInfo.Address
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue