louislam/uptime-kuma · error · Error
Unsupported proxy protocol "${proxy.protocol}. Supported pro
Error message
Unsupported proxy protocol "${proxy.protocol}. Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(", ")}." What it means
Thrown by Proxy.save when proxy.protocol is not in SUPPORTED_PROXY_PROTOCOLS = ['http','https','socks','socks5','socks5h','socks4']. Note the message string itself is malformed (misplaced quote and stray period): the user-facing text is `Unsupported proxy protocol "<protocol>. Supported protocols are http, https, socks, socks5, socks5h, socks4."` — a cosmetic bug, but the cause is clear.
Source
Thrown at server/proxy.js:35
* @param {number} userID ID of user the proxy belongs to
* @returns {Promise<Bean>} Updated proxy
*/
static async save(proxy, proxyID, userID) {
let bean;
if (proxyID) {
bean = await R.findOne("proxy", " id = ? AND user_id = ? ", [proxyID, userID]);
if (!bean) {
throw new Error("proxy not found");
}
} else {
bean = R.dispense("proxy");
}
// Make sure given proxy protocol is supported
if (!this.SUPPORTED_PROXY_PROTOCOLS.includes(proxy.protocol)) {
throw new Error(`
Unsupported proxy protocol "${proxy.protocol}.
Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(", ")}."`);
}
// When proxy is default update deactivate old default proxy
if (proxy.default) {
await R.exec("UPDATE proxy SET `default` = 0 WHERE `default` = 1");
}
bean.user_id = userID;
bean.protocol = proxy.protocol;
bean.host = proxy.host;
bean.port = proxy.port;
bean.auth = proxy.auth;
bean.username = proxy.username;
bean.password = proxy.password;
bean.active = proxy.active || true;
bean.default = proxy.default || false;View on GitHub (pinned to 6b5ea01557)
Solutions
- Set proxy.protocol to one of the exact lowercase values: http, https, socks, socks5, socks5h, socks4.
- If submitting via API, lowercase the value before sending (e.g. protocol.toLowerCase()).
- Update the frontend dropdown to emit only the canonical lowercase values.
- As a code fix, normalize case in Proxy.save before the includes() check and fix the broken quote in the error template.
Example fix
// before
if (!this.SUPPORTED_PROXY_PROTOCOLS.includes(proxy.protocol)) {
throw new Error(`
Unsupported proxy protocol "${proxy.protocol}.
Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(", ")}."`);
}
// after (normalize case, fix the malformed message)
const protocol = (proxy.protocol || "").toLowerCase();
if (!this.SUPPORTED_PROXY_PROTOCOLS.includes(protocol)) {
throw new Error(`Unsupported proxy protocol "${protocol}". Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(", ")}.`);
} Defensive patterns
Strategy: validation
Validate before calling
// Normalize and validate protocol before save
const protocol = (proxy.protocol || "").toLowerCase();
if (!Proxy.SUPPORTED_PROXY_PROTOCOLS.includes(protocol)) {
throw new Error(`Unsupported proxy protocol "${protocol}". Supported: ${Proxy.SUPPORTED_PROXY_PROTOCOLS.join(", ")}`);
} Type guard
/** True when protocol is one of the supported lowercase schemes. */
function isSupportedProxyProtocol(protocol) {
return typeof protocol === "string" &&
["http","https","socks","socks5","socks5h","socks4"].includes(protocol.toLowerCase());
} Try / catch
if (!isSupportedProxyProtocol(proxy.protocol)) {
throw new Error(`Unsupported proxy protocol "${proxy.protocol}". Supported: ${Proxy.SUPPORTED_PROXY_PROTOCOLS.join(", ")}`);
} Prevention
- Always submit lowercase protocol values.
- Fix the malformed message string in proxy.js:35-37.
- Add a client-side dropdown that only emits canonical values.
When it happens
Trigger: Empty protocol field, a capitalized value like 'HTTP' or 'SOCKS5' (the check is case-sensitive), a typo such as 'socks4a' or 'socks5H', or a frontend bug submitting the protocol label instead of its value.
Common situations: Manual API/DB edit setting protocol to an uppercase or unsupported scheme; older config using 'socks4a'; or a custom client sending the display name.
Related errors
- Unsupported recipient type: ${notification.threemaRecipientT
- Unsupported proxy protocol provided. ${proxy.protocol}
- Interval cannot be less than ${MIN_INTERVAL_SECOND} seconds
- Retry interval cannot be less than ${MIN_INTERVAL_SECOND} se
- Response max length cannot be less than 0
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/7689d7f0c71e9bc8.
Report an issue: GitHub.