{"record":{"id":"3a5137063e579cda","repo":"shadowsocks/shadowsocks-rust","slug":"http-https-outbound-proxy-requires-the-local-http","errorCode":null,"errorMessage":"HTTP/HTTPS outbound proxy requires the `local-http` feature","messagePattern":"HTTP/HTTPS outbound proxy requires the `local-http` feature","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/shadowsocks-service/src/net/outbound/chain.rs","lineNumber":125,"sourceCode":"    mut stream: OutboundProxyStream,\n    hop: &OutboundProxyHop,\n    next_target: &Address,\n) -> io::Result<OutboundProxyStream> {\n    match &hop.kind {\n        OutboundProxyKind::Socks5 { auth } => {\n            Socks5Negotiator::establish_tcp(&mut stream, next_target.clone(), auth)\n                .await\n                .map_err(io::Error::other)?;\n            Ok(stream)\n        }\n        #[cfg(feature = \"local-http\")]\n        OutboundProxyKind::Http { auth } | OutboundProxyKind::Https { auth, .. } => {\n            let local_addr = stream.local_addr()?;\n            let tunnel = HttpConnectClient::establish(stream, next_target, auth).await?;\n            Ok(OutboundProxyStream::from_http(local_addr, tunnel))\n        }\n        #[cfg(not(feature = \"local-http\"))]\n        OutboundProxyKind::Http { .. } | OutboundProxyKind::Https { .. } => Err(io::Error::new(\n            io::ErrorKind::Unsupported,\n            \"HTTP/HTTPS outbound proxy requires the `local-http` feature\",\n        )),\n    }\n}\n\n#[cfg(any(feature = \"local-http-native-tls\", feature = \"local-http-rustls\"))]\nasync fn tls_wrap(stream: OutboundProxyStream, sni: &str) -> io::Result<OutboundProxyStream> {\n    let local_addr = stream.local_addr()?;\n    let tls = tls_connect(stream, sni).await?;\n    Ok(OutboundProxyStream::from_tls(local_addr, tls))\n}\n\n#[cfg(not(any(feature = \"local-http-native-tls\", feature = \"local-http-rustls\")))]\nasync fn tls_wrap(_stream: OutboundProxyStream, _sni: &str) -> io::Result<OutboundProxyStream> {\n    super::tls::tls_unsupported()\n}\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/shadowsocks/shadowsocks-rust/blob/8eb0f0a65b1d976ab6bed5787327ef86529b0435/crates/shadowsocks-service/src/net/outbound/chain.rs#L107-L143","documentation":"The outbound proxy chain supports HTTP/HTTPS CONNECT proxies only when the crate is compiled with the `local-http` feature. negotiate_hop explicitly rejects Http/Https hop kinds with io::ErrorKind::Unsupported in builds without that feature. The proxy config parsed fine; the capability was compiled out.","triggerScenarios":"A config lists an `http` or `https` outbound proxy hop while the shadowsocks-service crate was built without `--features local-http`; connect_chain/negotiate_hop reaches that hop and returns Unsupported.","commonSituations":"Using a default `cargo build`/crates.io install that omits feature flags; feature was renamed or dropped between versions; a distro package built with a minimal feature set.","solutions":["Rebuild with the feature: cargo build --features local-http (plus the needed TLS backend)","Change the outbound proxy to a supported kind such as SOCKS5 for the current build","Check the package/distro build flags to confirm which features are enabled"],"exampleFix":"// before\ncargo build -p shadowsocks-service\n// after\ncargo build -p shadowsocks-service --features local-http","handlingStrategy":"validation","validationCode":"#[cfg(not(feature = \"local-http\"))]\nif matches!(hop.kind, OutboundProxyKind::Http{..} | OutboundProxyKind::Https{..}) {\n    return Err(anyhow!(\"http(s) hop requires building with --features local-http\"));\n}","typeGuard":"fn is_http_kind(k: &OutboundProxyKind) -> bool {\n    matches!(k, OutboundProxyKind::Http{..} | OutboundProxyKind::Https{..})\n}","tryCatchPattern":"match negotiate_result {\n    Err(e) if e.kind() == io::ErrorKind::Unsupported => eprintln!(\"rebuild with --features local-http\"),\n    other => other?,\n}","preventionTips":["Check crate features before writing http/https hops into config","Pin build features in CI so all environments match","Document required features next to the proxy config sample"],"tags":["feature-flags","proxy","compile-time"],"backgroundTag":"feature-not-enabled","analyzedSha":"8eb0f0a65b1d976ab6bed5787327ef86529b0435","analyzedAt":"2026-09-09T12:20:43.168Z","contentChangedAt":"2026-09-09T12:20:43.168Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}