Skip to content

Commit

Permalink
add flags
Browse files Browse the repository at this point in the history
add flags
  • Loading branch information
jiuker committed Jul 11, 2024
1 parent 1a634ec commit ccf6d6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ func clientTransport(ctx *cli.Context, enableTLS bool) http.RoundTripper {
tr.TLSClientConfig = &tls.Config{
RootCAs: getCertPool(ctx.GlobalString("cacert")),
Certificates: getCertKeyPair(ctx.GlobalString("client-cert"), ctx.GlobalString("client-key")),
InsecureSkipVerify: ctx.GlobalBool("insecure"),
InsecureSkipVerify: ctx.GlobalBool("insecure") || ctx.GlobalBool("rr-dns-mode"),
// Can't use SSLv3 because of POODLE and BEAST
// Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher
// Can't use TLSv1.1 because of RC4 cipher usage
Expand Down Expand Up @@ -874,7 +874,7 @@ func configureSite(ctxt context.Context, ctx *cli.Context, siteNum int, siteStrs
defer globalConnStatsRWMutex.Unlock()
// reset connstats
globalConnStats = []*ConnStats{}
if len(endpoints) == 1 {
if len(endpoints) == 1 && ctx.GlobalBool("rr-dns-mode") {
// guess it is LB config address
target, err := url.Parse(endpoints[0])
if err != nil {
Expand Down Expand Up @@ -1141,6 +1141,10 @@ func main() {
Name: "insecure, i",
Usage: "disable TLS certificate verification",
},
cli.BoolFlag{
Name: "rr-dns-mode",
Usage: "enable round-robin DNS mode",
},
cli.BoolFlag{
Name: "log, l",
Usage: "enable logging",
Expand Down

0 comments on commit ccf6d6d

Please sign in to comment.