kgretzky/evilginx2 · error
proxy address can't be empty
Error message
proxy address can't be empty
What it means
setProxy checks that a non-empty upstream proxy address was provided when the proxy is enabled. An empty address would produce an un-routable proxy URL, so configuration is rejected. This is a required-field validation on the address argument.
Source
Thrown at core/http_proxy.go:1917
p.ip_mtx.Lock()
defer p.ip_mtx.Unlock()
pl := p.getPhishletByPhishHost(hostname)
if pl != nil {
sid, ok := p.ip_sids[ip_addr+"-"+pl.Name]
return sid, ok
}
return "", false
}
func (p *HttpProxy) setProxy(enabled bool, ptype string, address string, port int, username string, password string) error {
if enabled {
ptypes := []string{"http", "https", "socks5", "socks5h"}
if !stringExists(ptype, ptypes) {
return fmt.Errorf("invalid proxy type selected")
}
if len(address) == 0 {
return fmt.Errorf("proxy address can't be empty")
}
if port == 0 {
return fmt.Errorf("proxy port can't be 0")
}
u := url.URL{
Scheme: ptype,
Host: address + ":" + strconv.Itoa(port),
}
if strings.HasPrefix(ptype, "http") {
var dproxy *http_dialer.HttpTunnel
if username != "" {
dproxy = http_dialer.New(&u, http_dialer.WithProxyAuth(http_dialer.AuthBasic(username, password)))
} else {
dproxy = http_dialer.New(&u)
}
p.Proxy.Tr.Dial = dproxy.DialView on GitHub (pinned to 4c0988a1d9)
Solutions
- Supply the proxy host/IP, e.g. `proxy socks5 127.0.0.1 9050 user pass`
- Check that any env var or config key holding the address is actually set and non-empty
- If you meant to disable the upstream proxy, pass enabled=false / `proxy off` instead of enabling with a blank address
- Ensure address and port were not swapped — port alone won't fill address
Example fix
// before p.setProxy(true, "socks5", "", 9050, "", "") // after p.setProxy(true, "socks5", "127.0.0.1", 9050, "", "")
Defensive patterns
Strategy: validation
Validate before calling
if enabled && len(address) == 0 {
return fmt.Errorf("proxy address is required when proxy is enabled")
} Type guard
func hasProxyAddress(addr string) bool {
return strings.TrimSpace(addr) != ""
} Try / catch
if err := proxy.setProxy(true, ptype, addr, port, user, pass); err != nil {
if strings.Contains(err.Error(), "address can't be empty") {
return fmt.Errorf("supply upstream proxy host, e.g. 127.0.0.1")
}
} Prevention
- Fill in the address field right after enabling a proxy
- Expand env vars and assert they are non-empty before use
- Use `proxy off` instead of enabling with blank fields
- Keep address and port in the documented order: type, address, port
When it happens
Trigger: Calling setProxy(true, "socks5", "", port, ...) or running the `proxy` command with the address field omitted/left blank, or a config file where the proxy address key is missing or empty string.
Common situations: Copying a proxy config example but forgetting to fill in the host, environment variable for proxy address unset and expanded to empty string, or partial paste of a proxy:port string into the wrong field.
Understand the failure class
Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.
Related errors
- invalid proxy type selected
- proxy port can't be 0
- login: `domain` field cannot be empty
- login: `domain` must contain a value of one of the hostnames
- invalid ip address: %s
AI-assisted analysis of kgretzky/evilginx2@4c0988a1d9 (2026-09-05).
Data as JSON: /api/errors/5a57f834a0967260.
Report an issue: GitHub.