{"record":{"id":"7689d7f0c71e9bc8","repo":"louislam/uptime-kuma","slug":"unsupported-proxy-protocol-proxy-protocol-sup","errorCode":null,"errorMessage":"Unsupported proxy protocol \"${proxy.protocol}. Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(\", \")}.\"","messagePattern":"Unsupported proxy protocol \"(.+?)\\. Supported protocols are (.+?)\\.\"","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/proxy.js","lineNumber":35,"sourceCode":"     * @param {number} userID ID of user the proxy belongs to\n     * @returns {Promise<Bean>} Updated proxy\n     */\n    static async save(proxy, proxyID, userID) {\n        let bean;\n\n        if (proxyID) {\n            bean = await R.findOne(\"proxy\", \" id = ? AND user_id = ? \", [proxyID, userID]);\n\n            if (!bean) {\n                throw new Error(\"proxy not found\");\n            }\n        } else {\n            bean = R.dispense(\"proxy\");\n        }\n\n        // Make sure given proxy protocol is supported\n        if (!this.SUPPORTED_PROXY_PROTOCOLS.includes(proxy.protocol)) {\n            throw new Error(`\n                Unsupported proxy protocol \"${proxy.protocol}.\n                Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(\", \")}.\"`);\n        }\n\n        // When proxy is default update deactivate old default proxy\n        if (proxy.default) {\n            await R.exec(\"UPDATE proxy SET `default` = 0 WHERE `default` = 1\");\n        }\n\n        bean.user_id = userID;\n        bean.protocol = proxy.protocol;\n        bean.host = proxy.host;\n        bean.port = proxy.port;\n        bean.auth = proxy.auth;\n        bean.username = proxy.username;\n        bean.password = proxy.password;\n        bean.active = proxy.active || true;\n        bean.default = proxy.default || false;","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/proxy.js#L17-L53","documentation":"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.","triggerScenarios":"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.","commonSituations":"Manual API/DB edit setting protocol to an uppercase or unsupported scheme; older config using 'socks4a'; or a custom client sending the display name.","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."],"exampleFix":"// before\nif (!this.SUPPORTED_PROXY_PROTOCOLS.includes(proxy.protocol)) {\n    throw new Error(`\n        Unsupported proxy protocol \"${proxy.protocol}.\n        Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(\", \")}.\"`);\n}\n// after (normalize case, fix the malformed message)\nconst protocol = (proxy.protocol || \"\").toLowerCase();\nif (!this.SUPPORTED_PROXY_PROTOCOLS.includes(protocol)) {\n    throw new Error(`Unsupported proxy protocol \"${protocol}\". Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(\", \")}.`);\n}","handlingStrategy":"validation","validationCode":"// Normalize and validate protocol before save\nconst protocol = (proxy.protocol || \"\").toLowerCase();\nif (!Proxy.SUPPORTED_PROXY_PROTOCOLS.includes(protocol)) {\n    throw new Error(`Unsupported proxy protocol \"${protocol}\". Supported: ${Proxy.SUPPORTED_PROXY_PROTOCOLS.join(\", \")}`);\n}","typeGuard":"/** True when protocol is one of the supported lowercase schemes. */\nfunction isSupportedProxyProtocol(protocol) {\n    return typeof protocol === \"string\" &&\n        [\"http\",\"https\",\"socks\",\"socks5\",\"socks5h\",\"socks4\"].includes(protocol.toLowerCase());\n}","tryCatchPattern":"if (!isSupportedProxyProtocol(proxy.protocol)) {\n    throw new Error(`Unsupported proxy protocol \"${proxy.protocol}\". Supported: ${Proxy.SUPPORTED_PROXY_PROTOCOLS.join(\", \")}`);\n}","preventionTips":["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."],"tags":["proxy","config","validation","enum","string-formatting"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}