Skip to content

Commit 9b47450

Browse files
committed
add mixed-port
1 parent c539790 commit 9b47450

8 files changed

+622
-150
lines changed

clashN/clashN/Forms/MainMsgControl.cs

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public void DisplayToolStatus(Config config)
7777
{
7878
StringBuilder sb = new StringBuilder();
7979

80+
sb.Append($"mixed {Global.Loopback}:{config.mixedPort}");
81+
sb.Append(" | ");
8082
sb.Append($"{Global.InboundSocks} {Global.Loopback}:{config.socksPort}");
8183
sb.Append(" | ");
8284
sb.Append($"{ Global.InboundHttp} { Global.Loopback}:{config.httpPort}");

clashN/clashN/Forms/OptionSettingForm.Designer.cs

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clashN/clashN/Forms/OptionSettingForm.cs

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ private void InitBase()
3333
cmbloglevel.Text = config.logLevel;
3434

3535
//本地监听
36+
txtmixedPort.Text = config.mixedPort.ToString();
3637
txthttpPort.Text = config.httpPort.ToString();
3738
txtsocksPort.Text = config.socksPort.ToString();
3839
txtAPIPort.Text = config.APIPort.ToString();
@@ -90,9 +91,15 @@ private int SaveBase()
9091
string loglevel = cmbloglevel.Text.TrimEx();
9192

9293
//本地监听
94+
string mixedPort = txtmixedPort.Text.TrimEx();
9395
string httpPort = txthttpPort.Text.TrimEx();
9496
string socksPort = txtsocksPort.Text.TrimEx();
9597
string APIPort = txtAPIPort.Text.TrimEx();
98+
if (Utils.IsNullOrEmpty(mixedPort) || !Utils.IsNumberic(mixedPort))
99+
{
100+
UI.Show(ResUI.FillLocalListeningPort);
101+
return -1;
102+
}
96103
if (Utils.IsNullOrEmpty(httpPort) || !Utils.IsNumberic(httpPort))
97104
{
98105
UI.Show(ResUI.FillLocalListeningPort);
@@ -109,6 +116,7 @@ private int SaveBase()
109116
return -1;
110117
}
111118

119+
config.mixedPort = Utils.ToInt(mixedPort);
112120
config.httpPort = Utils.ToInt(httpPort);
113121
config.socksPort = Utils.ToInt(socksPort);
114122
config.APIPort = Utils.ToInt(APIPort);

0 commit comments

Comments
 (0)