Skip to content

Commit

Permalink
add mixed-port
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed May 3, 2022
1 parent c539790 commit 9b47450
Show file tree
Hide file tree
Showing 8 changed files with 622 additions and 150 deletions.
2 changes: 2 additions & 0 deletions clashN/clashN/Forms/MainMsgControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public void DisplayToolStatus(Config config)
{
StringBuilder sb = new StringBuilder();

sb.Append($"mixed {Global.Loopback}:{config.mixedPort}");
sb.Append(" | ");
sb.Append($"{Global.InboundSocks} {Global.Loopback}:{config.socksPort}");
sb.Append(" | ");
sb.Append($"{ Global.InboundHttp} { Global.Loopback}:{config.httpPort}");
Expand Down
16 changes: 16 additions & 0 deletions clashN/clashN/Forms/OptionSettingForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions clashN/clashN/Forms/OptionSettingForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ private void InitBase()
cmbloglevel.Text = config.logLevel;

//本地监听
txtmixedPort.Text = config.mixedPort.ToString();
txthttpPort.Text = config.httpPort.ToString();
txtsocksPort.Text = config.socksPort.ToString();
txtAPIPort.Text = config.APIPort.ToString();
Expand Down Expand Up @@ -90,9 +91,15 @@ private int SaveBase()
string loglevel = cmbloglevel.Text.TrimEx();

//本地监听
string mixedPort = txtmixedPort.Text.TrimEx();
string httpPort = txthttpPort.Text.TrimEx();
string socksPort = txtsocksPort.Text.TrimEx();
string APIPort = txtAPIPort.Text.TrimEx();
if (Utils.IsNullOrEmpty(mixedPort) || !Utils.IsNumberic(mixedPort))
{
UI.Show(ResUI.FillLocalListeningPort);
return -1;
}
if (Utils.IsNullOrEmpty(httpPort) || !Utils.IsNumberic(httpPort))
{
UI.Show(ResUI.FillLocalListeningPort);
Expand All @@ -109,6 +116,7 @@ private int SaveBase()
return -1;
}

config.mixedPort = Utils.ToInt(mixedPort);
config.httpPort = Utils.ToInt(httpPort);
config.socksPort = Utils.ToInt(socksPort);
config.APIPort = Utils.ToInt(APIPort);
Expand Down
Loading

0 comments on commit 9b47450

Please sign in to comment.