mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 08:31:30 +00:00
Fix panic on create system proxy failed
This commit is contained in:
parent
9dcd427743
commit
e80084316d
|
@ -99,14 +99,16 @@ func (a *myInboundAdapter) Start() error {
|
||||||
} else {
|
} else {
|
||||||
listenAddrString = listenAddr.String()
|
listenAddrString = listenAddr.String()
|
||||||
}
|
}
|
||||||
a.systemProxy, err = settings.NewSystemProxy(a.ctx, M.ParseSocksaddrHostPort(listenAddrString, listenPort), a.protocol == C.TypeMixed)
|
var systemProxy settings.SystemProxy
|
||||||
|
systemProxy, err = settings.NewSystemProxy(a.ctx, M.ParseSocksaddrHostPort(listenAddrString, listenPort), a.protocol == C.TypeMixed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return E.Cause(err, "initialize system proxy")
|
return E.Cause(err, "initialize system proxy")
|
||||||
}
|
}
|
||||||
err = a.systemProxy.Enable()
|
err = systemProxy.Enable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return E.Cause(err, "set system proxy")
|
return E.Cause(err, "set system proxy")
|
||||||
}
|
}
|
||||||
|
a.systemProxy = systemProxy
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue