Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions internal/runner/options.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package runner

import (
"errors"
"math"
"os"
"path/filepath"
Expand Down Expand Up @@ -142,6 +143,10 @@ func ParseOptions() (*Options, error) {
readFlagsConfig(flagSet, options.ConfigDir)
}

if len(options.UpstreamHTTPProxies) > 0 && len(options.UpstreamSOCKS5Proxies) > 0 {
return nil, errors.New("can't use upstream HTTP proxies and upstream SOCKS5 proxies at the same time")
}

if cfgFile != "" {
if !fileutil.FileExists(cfgFile) {
gologger.Fatal().Msgf("given config file '%s' does not exist", cfgFile)
Expand Down
3 changes: 2 additions & 1 deletion internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ func (r *Runner) Run() error {

if len(r.options.UpstreamHTTPProxies) > 0 {
gologger.Info().Msgf("Using upstream HTTP proxies: %s\n", r.options.UpstreamHTTPProxies)
} else if len(r.options.UpstreamSOCKS5Proxies) > 0 {
}
if len(r.options.UpstreamSOCKS5Proxies) > 0 {
gologger.Info().Msgf("Using upstream SOCKS5 proxies: %s\n", r.options.UpstreamSOCKS5Proxies)
}

Expand Down
3 changes: 2 additions & 1 deletion proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ func (p *Proxy) getRoundTripper() (http.RoundTripper, error) {
roundtrip = &http.Transport{Proxy: func(req *http.Request) (*url.URL, error) {
return url.Parse(p.rbHTTP.Next())
}, TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}
} else if len(p.options.UpstreamSOCKS5Proxies) > 0 {
}
if len(p.options.UpstreamSOCKS5Proxies) > 0 {
// for each socks5 proxy create a dialer
socks5Dialers := make(map[string]proxy.Dialer)
for _, socks5Proxy := range p.options.UpstreamSOCKS5Proxies {
Expand Down
Loading