Code maintenance: http proxy starts from Run func
This commit is contained in:
@@ -269,10 +269,6 @@ func _main(background context.Context, buildInfo models.BuildInformation,
|
|||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go shadowsocksLooper.Run(ctx, wg)
|
go shadowsocksLooper.Run(ctx, wg)
|
||||||
|
|
||||||
if allSettings.HTTPProxy.Enabled {
|
|
||||||
_, _ = httpProxyLooper.SetStatus(constants.Running)
|
|
||||||
}
|
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go routeReadyEvents(ctx, wg, buildInfo, tunnelReadyCh, dnsReadyCh,
|
go routeReadyEvents(ctx, wg, buildInfo, tunnelReadyCh, dnsReadyCh,
|
||||||
unboundLooper, updaterLooper, publicIPLooper, routingConf, logger, httpClient,
|
unboundLooper, updaterLooper, publicIPLooper, routingConf, logger, httpClient,
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ func (l *looper) Run(ctx context.Context, wg *sync.WaitGroup) {
|
|||||||
|
|
||||||
crashed := false
|
crashed := false
|
||||||
|
|
||||||
|
if l.GetSettings().Enabled {
|
||||||
|
go func() {
|
||||||
|
_, _ = l.SetStatus(constants.Running)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-l.start:
|
case <-l.start:
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
@@ -74,6 +80,7 @@ func (l *looper) Run(ctx context.Context, wg *sync.WaitGroup) {
|
|||||||
errorCh := make(chan error)
|
errorCh := make(chan error)
|
||||||
go server.Run(runCtx, runWg, errorCh)
|
go server.Run(runCtx, runWg, errorCh)
|
||||||
|
|
||||||
|
// TODO stable timer, check Shadowsocks
|
||||||
if !crashed {
|
if !crashed {
|
||||||
l.running <- constants.Running
|
l.running <- constants.Running
|
||||||
crashed = false
|
crashed = false
|
||||||
|
|||||||
Reference in New Issue
Block a user