Code maintenance: HTTP proxy loop reworked

- Blocking method calls on loop
- Restart proxy when settings change
- Detect server crash error and restart it
This commit is contained in:
Quentin McGaw
2020-12-30 18:44:46 +00:00
parent e827079604
commit 6f3a074e00
4 changed files with 177 additions and 85 deletions

View File

@@ -271,7 +271,7 @@ func _main(background context.Context, buildInfo models.BuildInformation,
go shadowsocksLooper.Run(ctx, wg)
if allSettings.HTTPProxy.Enabled {
httpProxyLooper.Restart()
_, _ = httpProxyLooper.SetStatus(constants.Running)
}
if allSettings.ShadowSocks.Enabled {
restartShadowsocks()