Skip to content

Commit

Permalink
feat: lazy option for client
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyxdd committed Aug 6, 2023
1 parent 2c7db03 commit 601ad6b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type clientConfig struct {
QUIC clientConfigQUIC `mapstructure:"quic"`
Bandwidth clientConfigBandwidth `mapstructure:"bandwidth"`
FastOpen bool `mapstructure:"fastOpen"`
Lazy bool `mapstructure:"lazy"`
SOCKS5 *socks5Config `mapstructure:"socks5"`
HTTP *httpConfig `mapstructure:"http"`
Forwarding []forwardingEntry `mapstructure:"forwarding"`
Expand Down Expand Up @@ -312,7 +313,7 @@ func runClient(cmd *cobra.Command, args []string) {
logger.Fatal("failed to load client config", zap.Error(err))
}

c, err := client.NewReconnectableClient(hyConfig, connectLog, false)
c, err := client.NewReconnectableClient(hyConfig, connectLog, config.Lazy)
if err != nil {
logger.Fatal("failed to initialize client", zap.Error(err))
}
Expand Down
1 change: 1 addition & 0 deletions app/cmd/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func TestClientConfig(t *testing.T) {
Down: "1 gbps",
},
FastOpen: true,
Lazy: true,
SOCKS5: &socks5Config{
Listen: "127.0.0.1:1080",
Username: "anon",
Expand Down
2 changes: 2 additions & 0 deletions app/cmd/client_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ bandwidth:

fastOpen: true

lazy: true

socks5:
listen: 127.0.0.1:1080
username: anon
Expand Down

0 comments on commit 601ad6b

Please sign in to comment.