mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-08-19 15:51:45 +00:00
Add lazy_start
option.
When on, the client will not attempt to connect to the server at startup, only when a connection is initiated.
This commit is contained in:
@@ -136,6 +136,7 @@ func client(config *clientConfig) {
|
||||
for {
|
||||
try += 1
|
||||
c, err := cs.NewClient(config.Server, auth, tlsConfig, quicConfig, pktConnFunc, up, down, config.FastOpen,
|
||||
config.LazyStart,
|
||||
func(err error) {
|
||||
if config.QuitOnDisconnect {
|
||||
logrus.WithFields(logrus.Fields{
|
||||
@@ -170,7 +171,12 @@ func client(config *clientConfig) {
|
||||
}
|
||||
}
|
||||
defer client.Close()
|
||||
logrus.WithField("addr", config.Server).Info("Connected")
|
||||
if config.LazyStart {
|
||||
logrus.WithField("addr", config.Server).Info("Option lazy_start specified. Server connection deferred.")
|
||||
|
||||
} else {
|
||||
logrus.WithField("addr", config.Server).Info("Connected")
|
||||
}
|
||||
|
||||
// Local
|
||||
errChan := make(chan error)
|
||||
|
Reference in New Issue
Block a user