Skip to content

Commit

Permalink
add http proxy support
Browse files Browse the repository at this point in the history
  • Loading branch information
HuanMeng0 authored and fbreckle committed Aug 15, 2024
1 parent 43c2dc4 commit 028686d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions netbox/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 028686d

Please sign in to comment.