mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-14 09:48:47 +07:00
feat: support bind to wan
This commit is contained in:
16
cmd/run.go
16
cmd/run.go
@ -70,9 +70,19 @@ func Run() (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// Bind to link.
|
||||
if err = t.BindLink(param.Global.LanInterface); err != nil {
|
||||
return err
|
||||
// Bind to links.
|
||||
if param.Global.LanInterface == "" && param.Global.WanInterface == "" {
|
||||
return fmt.Errorf("LanInterface and WanInterface cannot both be empty")
|
||||
}
|
||||
if param.Global.LanInterface != "" {
|
||||
if err = t.BindLan(param.Global.LanInterface); err != nil {
|
||||
return fmt.Errorf("BindLan: %v: %w", param.Global.LanInterface, err)
|
||||
}
|
||||
}
|
||||
if param.Global.WanInterface != "" {
|
||||
if err = t.BindWan(param.Global.WanInterface); err != nil {
|
||||
return fmt.Errorf("BindWan: %v: %w", param.Global.WanInterface, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Serve tproxy TCP/UDP server util signals.
|
||||
|
Reference in New Issue
Block a user