mirror of
https://github.com/fatedier/frp.git
synced 2025-06-17 17:18:21 +00:00
Merge e0f2c3bc31abacc2fd62c8fce663ce9a1ba1ea5c into 69cc422edf695a7f1f524e427fa175aee79ac3e3
This commit is contained in:
commit
fa019474b3
@ -169,6 +169,15 @@ func (svr *Service) Run(ctx context.Context) error {
|
||||
netpkg.SetDefaultDNSAddress(svr.common.DNSServer)
|
||||
}
|
||||
|
||||
if svr.webServer != nil {
|
||||
go func() {
|
||||
log.Infof("admin server listen on %s", svr.webServer.Address())
|
||||
if err := svr.webServer.Run(); err != nil {
|
||||
log.Warnf("admin server exit with error: %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// first login to frps
|
||||
svr.loopLoginUntilSuccess(10*time.Second, lo.FromPtr(svr.common.LoginFailExit))
|
||||
if svr.ctl == nil {
|
||||
@ -179,14 +188,6 @@ func (svr *Service) Run(ctx context.Context) error {
|
||||
|
||||
go svr.keepControllerWorking()
|
||||
|
||||
if svr.webServer != nil {
|
||||
go func() {
|
||||
log.Infof("admin server listen on %s", svr.webServer.Address())
|
||||
if err := svr.webServer.Run(); err != nil {
|
||||
log.Warnf("admin server exit with error: %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
<-svr.ctx.Done()
|
||||
svr.stop()
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user