Skip to content

Commit

Permalink
cmd/uplink: add --client.enable-quic flag
Browse files Browse the repository at this point in the history
Change-Id: I19e81ecb98688fd0a36174fd06c363e9c40b3866
  • Loading branch information
VinozzZ authored and Yingrong Zhao committed Mar 19, 2021
1 parent a044957 commit bf4fdc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/uplink/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var mon = monkit.Package()
type ClientConfig struct {
UserAgent string `help:"User-Agent used for connecting to the satellite" default:""`
DialTimeout time.Duration `help:"timeout for dials" default:"0h2m00s"`
EnableQUIC bool `help:"Use QUIC as the transport protocol when it's available, otherwise, fallback to TCP" default:"false"`
}

// Config uplink configuration.
Expand Down
5 changes: 5 additions & 0 deletions cmd/uplink/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ import (
"storj.io/common/storj"
"storj.io/private/cfgstruct"
"storj.io/private/process"
"storj.io/storj/pkg/server"
"storj.io/storj/private/version/checker"
"storj.io/uplink"
privateAccess "storj.io/uplink/private/access"
"storj.io/uplink/private/transport"
)

const advancedFlagName = "advanced"
Expand Down Expand Up @@ -92,6 +94,9 @@ func (cliCfg *UplinkFlags) getProject(ctx context.Context, encryptionBypass bool
uplinkCfg := uplink.Config{}
uplinkCfg.UserAgent = cliCfg.Client.UserAgent
uplinkCfg.DialTimeout = cliCfg.Client.DialTimeout
if cliCfg.Client.EnableQUIC {
transport.SetConnector(&uplinkCfg, server.NewDefaultHybridConnector(nil, nil))
}

if encryptionBypass {
err = privateAccess.EnablePathEncryptionBypass(access)
Expand Down

0 comments on commit bf4fdc7

Please sign in to comment.