mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-16 09:19:51 +00:00
feat: lazy option for client
This commit is contained in:
parent
2c7db03243
commit
601ad6b61c
@ -50,6 +50,7 @@ type clientConfig struct {
|
|||||||
QUIC clientConfigQUIC `mapstructure:"quic"`
|
QUIC clientConfigQUIC `mapstructure:"quic"`
|
||||||
Bandwidth clientConfigBandwidth `mapstructure:"bandwidth"`
|
Bandwidth clientConfigBandwidth `mapstructure:"bandwidth"`
|
||||||
FastOpen bool `mapstructure:"fastOpen"`
|
FastOpen bool `mapstructure:"fastOpen"`
|
||||||
|
Lazy bool `mapstructure:"lazy"`
|
||||||
SOCKS5 *socks5Config `mapstructure:"socks5"`
|
SOCKS5 *socks5Config `mapstructure:"socks5"`
|
||||||
HTTP *httpConfig `mapstructure:"http"`
|
HTTP *httpConfig `mapstructure:"http"`
|
||||||
Forwarding []forwardingEntry `mapstructure:"forwarding"`
|
Forwarding []forwardingEntry `mapstructure:"forwarding"`
|
||||||
@ -312,7 +313,7 @@ func runClient(cmd *cobra.Command, args []string) {
|
|||||||
logger.Fatal("failed to load client config", zap.Error(err))
|
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 {
|
if err != nil {
|
||||||
logger.Fatal("failed to initialize client", zap.Error(err))
|
logger.Fatal("failed to initialize client", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ func TestClientConfig(t *testing.T) {
|
|||||||
Down: "1 gbps",
|
Down: "1 gbps",
|
||||||
},
|
},
|
||||||
FastOpen: true,
|
FastOpen: true,
|
||||||
|
Lazy: true,
|
||||||
SOCKS5: &socks5Config{
|
SOCKS5: &socks5Config{
|
||||||
Listen: "127.0.0.1:1080",
|
Listen: "127.0.0.1:1080",
|
||||||
Username: "anon",
|
Username: "anon",
|
||||||
|
@ -27,6 +27,8 @@ bandwidth:
|
|||||||
|
|
||||||
fastOpen: true
|
fastOpen: true
|
||||||
|
|
||||||
|
lazy: true
|
||||||
|
|
||||||
socks5:
|
socks5:
|
||||||
listen: 127.0.0.1:1080
|
listen: 127.0.0.1:1080
|
||||||
username: anon
|
username: anon
|
||||||
|
Loading…
x
Reference in New Issue
Block a user