Correct listen address in status bar when allowLANConn is on

Previously, all addresses in the status bar use loopback as host even
when allowLANConn is on, which is rather confusing. This commit
changes 127.0.0.1 to 0.0.0.0 when allowLANConn is on, reflecting the
fact that v2ray is listening on all interfaces.
This commit is contained in:
Zhiming Wang 2020-07-18 01:48:34 +08:00
parent 5c9c35c199
commit 6111ade007
No known key found for this signature in database
GPG key ID: 5B58F95EC95965D8

View file

@ -347,11 +347,12 @@ namespace v2rayN.Forms
toolSslHttpPort.Text =
toolSslPacPort.Text = "OFF";
toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
var listen = config.allowLANConn ? "0.0.0.0" : Global.Loopback;
toolSslSocksPort.Text = $"{listen}:{config.inbound[0].localPort}";
if (config.listenerType != (int)ListenerType.noHttpProxy)
{
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
toolSslHttpPort.Text = $"{listen}:{Global.httpPort}";
if (config.listenerType == ListenerType.GlobalPac ||
config.listenerType == ListenerType.PacOpenAndClear ||
config.listenerType == ListenerType.PacOpenOnly)