shadowsocks/shadowsocks-windows · warning · ArgumentException
Port can't be 8123
Error message
Port can't be 8123
What it means
ArgumentException thrown by CheckLocalPort when the local listener port is exactly 8123. Port 8123 is reserved by Shadowsocks for its internal HTTP proxy forwarding (privoxy/polipo), so binding the local SOCKS listener there would collide. CheckLocalPort runs CheckPort first, then rejects 8123.
Source
Thrown at shadowsocks-csharp/Model/Configuration.cs:362
return server;
}
public static Server GetDefaultServer()
{
return new Server();
}
public static void CheckPort(int port)
{
if (port <= 0 || port > 65535)
throw new ArgumentException(I18N.GetString("Port out of range"));
}
public static void CheckLocalPort(int port)
{
CheckPort(port);
if (port == 8123)
throw new ArgumentException(I18N.GetString("Port can't be 8123"));
}
private static void CheckPassword(string password)
{
if (string.IsNullOrEmpty(password))
throw new ArgumentException(I18N.GetString("Password can not be blank"));
}
public static void CheckServer(string server)
{
if (string.IsNullOrEmpty(server))
throw new ArgumentException(I18N.GetString("Server IP can not be blank"));
}
public static void CheckTimeout(int timeout, int maxTimeout)
{
if (timeout <= 0 || timeout > maxTimeout)
throw new ArgumentException(
View on GitHub (pinned to 891d971682)
Solutions
- Pick a different local port for the SOCKS listener (e.g. 1080, 1086, 7890).
- If 8123 is genuinely desired, change the internal HTTP proxy port instead so the two do not clash.
Example fix
// before Configuration.CheckLocalPort(8123); // reserved // after Configuration.CheckLocalPort(1080);
Defensive patterns
Strategy: validation
Validate before calling
static bool IsValidLocalPort(int p) => p > 0 && p <= 65535 && p != 8123; if (!IsValidLocalPort(port)) return; // surface error in UI
Try / catch
try { Configuration.CheckLocalPort(port); }
catch (ArgumentException ex) { /* show ex.Message, keep the dialog open */ } Prevention
- Avoid 8123 for the local listener; it is reserved for the HTTP proxy.
- Document reserved ports in the GUI tooltip.
When it happens
Trigger: The user sets the local port to 8123 in settings. An imported or pasted config specifies localPort 8123. A config migration copied the HTTP-proxy port into the SOCKS-port field.
Common situations: Choosing 8123 because it appears free. Migrating from an older setup that reused the HTTP proxy port as the SOCKS port.
Related errors
- Port out of range
- Server IP can not be blank
- Unknown forward proxy.
- Password can not be blank
- Timeout is invalid, it should not exceed {0}
AI-assisted analysis of shadowsocks/shadowsocks-windows@891d971682 (2026-08-13).
Data as JSON: /api/errors/757f3d89b1f1c908.
Report an issue: GitHub.