Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenWithFallback ¶
ListenWithFallback opens a TCP listener on `addr`. When `host` is a literal IP that the host kernel cannot bind (the typical "EADDRNOTAVAIL" error after restoring a backup from another machine), the function logs a warning and retries on the loopback interface (127.0.0.1) only. This keeps the panel reachable locally (e.g. over an SSH tunnel) so the operator can correct the listen address from the UI, without ever silently widening an intentionally-restricted bind to every (public) interface.
`host` is the bare host portion (no port) used by the caller to build `addr`; pass an empty string when the address is already an "any" address or when no fallback is desired.
Types ¶
type AutoHttpsConn ¶
type AutoHttpsListener ¶
type ListenResult ¶
type ListenResult struct {
Listener net.Listener
RequestedAddr string
FallbackAddr string
Fallback bool
BindError error
}
func ListenWithFallbackResult ¶
func ListenWithFallbackResult(addr, host string, port string) (ListenResult, error)