Add config options for ListenAddr & Interfaces

These options are helpful when the bridge is running on a multi-homed
device like a wireless router.
This commit is contained in:
Darell Tan
2023-08-03 23:28:52 +08:00
parent 3cfc3f68b0
commit 59b049faea
4 changed files with 50 additions and 0 deletions

View File

@@ -51,6 +51,10 @@ type Bridge struct {
Username string
Password string
// address and interfaces to bind to
ListenAddr string
Interfaces []string
DebugMode bool
ctx context.Context
@@ -118,6 +122,9 @@ func (br *Bridge) StartHAP() error {
return err
}
br.server.Addr = br.ListenAddr
br.server.Ifaces = br.Interfaces
if br.DebugMode {
haplog.Debug.Enable()
}