MCPcopy
hub / github.com/caddyserver/caddy / dialAddr

Method dialAddr

modules/caddyhttp/reverseproxy/addresses.go:31–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31func (p parsedAddr) dialAddr() string {
32 if !p.valid {
33 return ""
34 }
35 // for simplest possible config, we only need to include
36 // the network portion if the user specified one
37 if p.network != "" {
38 return caddy.JoinNetworkAddress(p.network, p.host, p.port)
39 }
40
41 // if the host is a placeholder, then we don't want to join with an empty port,
42 // because that would just append an extra ':' at the end of the address.
43 if p.port == "" && strings.Contains(p.host, "{") {
44 return p.host
45 }
46 return net.JoinHostPort(p.host, p.port)
47}
48
49func (p parsedAddr) rangedPort() bool {
50 return strings.Contains(p.port, "-")

Callers 3

UnmarshalCaddyfileMethod · 0.80
cmdReverseProxyFunction · 0.80

Calls 1

JoinHostPortMethod · 0.80

Tested by 1