Feature: support customizing bind-address when allow-lan is true (#255)

This commit is contained in:
Siji
2019-08-08 13:45:07 +08:00
committed by Dreamacro
parent 288afd1308
commit 5829c3d5be
5 changed files with 48 additions and 20 deletions

View File

@ -46,6 +46,7 @@ func GetGeneral() *config.General {
RedirPort: ports.RedirPort,
Authentication: authenticator,
AllowLan: P.AllowLan(),
BindAddress: P.BindAddress(),
Mode: T.Instance().Mode(),
LogLevel: log.Level(),
}
@ -105,6 +106,9 @@ func updateGeneral(general *config.General) {
allowLan := general.AllowLan
P.SetAllowLan(allowLan)
bindAddress := general.BindAddress
P.SetBindAddress(bindAddress)
if err := P.ReCreateHTTP(general.Port); err != nil {
log.Errorln("Start HTTP server error: %s", err.Error())
}