Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support rr_dns lookup host #113

Merged
merged 12 commits into from
Jul 16, 2024
Merged
Changes from 1 commit
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
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
Loading