From 9990e03b0526b00af361787ddb1d65bab71647c5 Mon Sep 17 00:00:00 2001 From: HuanMeng0 <11138015+HuanMeng0@users.noreply.github.com> Date: Tue, 13 Aug 2024 18:51:04 +0800 Subject: [PATCH] add http proxy support --- netbox/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netbox/client.go b/netbox/client.go index a176247d..553beb14 100644 --- a/netbox/client.go +++ b/netbox/client.go @@ -60,6 +60,8 @@ func (cfg *Config) Client() (*netboxclient.NetBoxAPI, error) { return nil, err } + trans.(*http.Transport).Proxy = http.ProxyFromEnvironment + if cfg.Headers != nil && len(cfg.Headers) > 0 { log.WithFields(log.Fields{ "custom_headers": cfg.Headers,