Add wireguard outbound and test
This commit is contained in:
28
box.go
28
box.go
@@ -177,7 +177,33 @@ func (s *Box) Start() error {
|
||||
for g := 0; g < i; g++ {
|
||||
s.inbounds[g].Close()
|
||||
}
|
||||
return err
|
||||
var tag string
|
||||
if in.Tag() == "" {
|
||||
tag = F.ToString(i)
|
||||
} else {
|
||||
tag = in.Tag()
|
||||
}
|
||||
return E.Cause(err, "initialize inbound/", in.Type(), "[", tag, "]")
|
||||
}
|
||||
}
|
||||
for i, out := range s.outbounds {
|
||||
if starter, isStarter := out.(common.Starter); isStarter {
|
||||
err = starter.Start()
|
||||
if err != nil {
|
||||
for _, in := range s.inbounds {
|
||||
common.Close(in)
|
||||
}
|
||||
for g := 0; g < i; g++ {
|
||||
common.Close(s.outbounds[g])
|
||||
}
|
||||
var tag string
|
||||
if out.Tag() == "" {
|
||||
tag = F.ToString(i)
|
||||
} else {
|
||||
tag = out.Tag()
|
||||
}
|
||||
return E.Cause(err, "initialize outbound/", out.Type(), "[", tag, "]")
|
||||
}
|
||||
}
|
||||
}
|
||||
if s.clashServer != nil {
|
||||
|
||||
Reference in New Issue
Block a user