From c2e74beebd53a71c0b5aa8840f42f2b68f4e5755 Mon Sep 17 00:00:00 2001 From: deviantony Date: Tue, 5 Dec 2023 23:42:07 +0000 Subject: [PATCH] feat: socks5 proxy support --- os/options.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/os/options.go b/os/options.go index ad53e62f0..6a4765265 100644 --- a/os/options.go +++ b/os/options.go @@ -128,6 +128,12 @@ func (parser *EnvOptionParser) Options() (*agent.Options, error) { httpProxy = *fEdgeTunnelHttpProxy } + // When using socks5 proxy (which is the format Docker expects) + // we convert to socks:// (which is the format that chisel expects) + if strings.HasPrefix(httpProxy, "socks5://") { + httpProxy = strings.ReplaceAll(httpProxy, "socks5://", "socks://") + } + return &agent.Options{ AssetsPath: *fAssetsPath, AgentServerAddr: fAgentServerAddr.String(),