AlistGo/alist · error
remote_port is required for tcp proxy type
Error message
remote_port is required for tcp proxy type
What it means
Returned by buildConfig when proxy type is 'tcp' but the remote port setting is 0 or negative. TCP proxies in frp expose a fixed port on the frps server, so remote_port is mandatory; other types (http/https/stcp) do not need it, which is why only this branch validates it.
Source
Thrown at internal/frp/frp.go:312
}
proxyCfgs = append(proxyCfgs, p)
case "https":
p := &v1.HTTPSProxyConfig{}
p.Name = proxyName
p.Type = "https"
p.ProxyBackend = backend
if customDomain != "" {
p.CustomDomains = []string{customDomain}
}
if subdomain != "" {
p.SubDomain = subdomain
}
proxyCfgs = append(proxyCfgs, p)
case "tcp":
if remotePort <= 0 {
return nil, nil, fmt.Errorf("remote_port is required for tcp proxy type")
}
p := &v1.TCPProxyConfig{}
p.Name = proxyName
p.Type = "tcp"
p.ProxyBackend = backend
p.RemotePort = remotePort
proxyCfgs = append(proxyCfgs, p)
case "stcp":
p := &v1.STCPProxyConfig{}
p.Name = proxyName
p.Type = "stcp"
p.ProxyBackend = backend
p.Secretkey = stcpSecretKey
p.AllowUsers = []string{"*"}
proxyCfgs = append(proxyCfgs, p)
default:View on GitHub (pinned to 843d9dc814)
Solutions
- Set a valid FRP remote port (1-65535, and one allowed by frps's allowPorts) in settings.
- If you do not need a fixed exposed port, switch the proxy type to http/https/stcp instead.
- Verify the port is not already taken on the frps server.
Defensive patterns
Strategy: validation
Validate before calling
if strings.ToLower(proxyType) == "tcp" && remotePort <= 0 {
return fmt.Errorf("remote_port must be 1-65535 for tcp proxy")
} Prevention
- Validate proxy-type-specific fields together: tcp requires remote_port in 1-65535.
- Use a dropdown limited to http/https/tcp/stcp in settings UI.
- Cross-check the chosen port against frps allowPorts configuration.
When it happens
Trigger: Setting conf.FRPProxyType to 'tcp' while FRPRemotePort is unset (defaults to 0) or set to a negative number, then starting the FRP client.
Common situations: Copying an http-type FRP config and switching the type to tcp without adding remote_port; remote_port field left at its zero default in the admin UI.
Related errors
- frp server address is required
- unsupported proxy type: %s
- not support index: %s
- directory separator prohibited
- name token must come before chunk token
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/4e1196b7f186cbe1.
Report an issue: GitHub.