{"record":{"id":"11a2421c14a43a07","repo":"shadowsocks/shadowsocks-rust","slug":"server-shouldn-t-be-an-unspecified-address-inad","errorCode":null,"errorMessage":"`server` shouldn't be an unspecified address (INADDR_ANY)","messagePattern":"`server` shouldn't be an unspecified address \\(INADDR_ANY\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/shadowsocks-service/src/config.rs","lineNumber":2932,"sourceCode":"                && plugin.plugin.trim().is_empty()\n            {\n                let err = Error::new(ErrorKind::Malformed, \"`plugin` shouldn't be an empty string\", None);\n                return Err(err);\n            }\n\n            // Server's domain name shouldn't be an empty string\n            match server.addr() {\n                ServerAddr::SocketAddr(sa) => {\n                    if sa.port() == 0 {\n                        let err = Error::new(ErrorKind::Malformed, \"`server_port` shouldn't be 0\", None);\n                        return Err(err);\n                    }\n\n                    if self.config_type.is_local() {\n                        // Only server could bind to INADDR_ANY\n                        let ip = sa.ip();\n                        if ip.is_unspecified() {\n                            let err = Error::new(\n                                ErrorKind::Malformed,\n                                \"`server` shouldn't be an unspecified address (INADDR_ANY)\",\n                                None,\n                            );\n                            return Err(err);\n                        }\n                    }\n\n                    #[cfg(feature = \"local-online-config\")]\n                    if self.config_type.is_online_config() {\n                        // Only server could bind to INADDR_ANY\n                        let ip = sa.ip();\n                        if ip.is_unspecified() {\n                            let err = Error::new(\n                                ErrorKind::Malformed,\n                                \"`server` shouldn't be an unspecified address (INADDR_ANY)\",\n                                None,\n                            );","sourceCodeStart":2914,"sourceCodeEnd":2950,"githubUrl":"https://github.com/shadowsocks/shadowsocks-rust/blob/8eb0f0a65b1d976ab6bed5787327ef86529b0435/crates/shadowsocks-service/src/config.rs#L2914-L2950","documentation":"For local-mode configurations, the remote server address must be a concrete host — it cannot be an unspecified address (0.0.0.0 or ::). INADDR_ANY is only meaningful for listeners, not for the server a local client connects to, so Config::check rejects it with ErrorKind::Malformed.","triggerScenarios":"A local (sslocal) config where a server entry's address is 0.0.0.0 or :: with a non-zero port, e.g. server = \"0.0.0.0\", or an ss:// URL with host 0.0.0.0.","commonSituations":"Users copying the bind-address 0.0.0.0 (correct for ssserver listeners) into the server field of an sslocal config; subscription data with an unspecified address; templates that substitute an empty host defaulting to 0.0.0.0.","solutions":["Replace the unspecified address with the actual server IP or hostname, e.g. server = \"1.2.3.4\" or \"example.com\".","Do not use 0.0.0.0 in local configs — that value belongs only in local_address/listen addresses for servers.","Fix the subscription/provider data if it is publishing 0.0.0.0 as the server address."],"exampleFix":"// before (local.json)\n{ \"server\": \"0.0.0.0\", \"server_port\": 8388, \"password\": \"pw\", \"method\": \"aes-256-gcm\" }\n\n// after\n{ \"server\": \"203.0.113.7\", \"server_port\": 8388, \"password\": \"pw\", \"method\": \"aes-256-gcm\" }","handlingStrategy":"validation","validationCode":"// Rust\nif let Ok(ip) = server.parse::<std::net::IpAddr>() {\n    assert!(!ip.is_unspecified(), \"local config server must not be 0.0.0.0 or ::\");\n}","typeGuard":"fn is_concrete_host(host: &str) -> bool {\n    match host.parse::<std::net::IpAddr>() {\n        Ok(ip) => !ip.is_unspecified(),\n        Err(_) => !host.trim().is_empty(),\n    }\n}","tryCatchPattern":null,"preventionTips":["Use 0.0.0.0 only for server bind/listen addresses, never for the remote server field.","Copy configs from the correct role's template (local vs server).","Reject 0.0.0.0 in config-generation tooling for local mode."],"tags":["config","address","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"8eb0f0a65b1d976ab6bed5787327ef86529b0435","analyzedAt":"2026-09-09T12:20:43.168Z","contentChangedAt":"2026-09-09T12:20:43.168Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}