1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-25 06:36:08 +03:00

添加服务端参数显示窗口

This commit is contained in:
ProxySU 2020-03-22 16:07:46 +08:00
parent cdd0d6b844
commit 4f98cfe560
5 changed files with 72 additions and 14 deletions

View File

@ -39,6 +39,8 @@ namespace ProxySU
RadioButtonProxyNoLogin.IsChecked = true; RadioButtonProxyNoLogin.IsChecked = true;
RadioButtonSocks4.Visibility = Visibility.Collapsed; RadioButtonSocks4.Visibility = Visibility.Collapsed;
ReceiveConfigurationParameters = new string[6]; ReceiveConfigurationParameters = new string[6];
//ReceiveConfigurationParameters[4] = "domaintext";
} }
//开始布署安装 //开始布署安装
@ -208,8 +210,13 @@ namespace ProxySU
appConfig = "TemplateConfg\\TLS_server_config.json"; appConfig = "TemplateConfg\\TLS_server_config.json";
clientConfig = "TemplateConfg\\tcp_client_config.json"; clientConfig = "TemplateConfg\\tcp_client_config.json";
} }
Task task = new Task(() => StartSetUpRemoteHost(connectionInfo, TextBlockSetUpProcessing, ProgressBarSetUpProcessing, appConfig, clientConfig, upLoadPath)); //Thread thread
task.Start(); Thread thread = new Thread(() => StartSetUpRemoteHost(connectionInfo, TextBlockSetUpProcessing, ProgressBarSetUpProcessing, appConfig, clientConfig, upLoadPath));
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
// Task task = new Task(() => StartSetUpRemoteHost(connectionInfo, TextBlockSetUpProcessing, ProgressBarSetUpProcessing, appConfig, clientConfig, upLoadPath));
//task.Start();
} }
#region #region
@ -516,7 +523,8 @@ namespace ProxySU
textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus); textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
Thread.Sleep(1000); Thread.Sleep(1000);
//MessageBox.Show("客户端配置文件已保存在config文件夹中"); //显示服务端连接参数
//MessageBox.Show("用于V2ray官方客户端的配置文件已保存在config文件夹中");
ResultClientInformation resultClientInformation = new ResultClientInformation(); ResultClientInformation resultClientInformation = new ResultClientInformation();
resultClientInformation.ShowDialog(); resultClientInformation.ShowDialog();

View File

@ -26,29 +26,30 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="地址(address)" Grid.Column="0" Grid.Row="0" Margin="8"></TextBlock> <TextBlock Text="地址(address)" Grid.Column="0" Grid.Row="0" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxHostAddress" Grid.Column="1" Grid.Row="0" Margin="8"></TextBox> <TextBox x:Name="TextBoxHostAddress" IsReadOnly="True" Grid.Column="1" Grid.Row="0" Margin="8"></TextBox>
<TextBlock Text="说明" Grid.Column="2" Grid.Row="0"></TextBlock> <TextBlock Text="说明" Grid.Column="2" Grid.Row="0"></TextBlock>
<TextBlock Text="端口(port)" Grid.Column="0" Grid.Row="1" Margin="8"></TextBlock> <TextBlock Text="端口(port)" Grid.Column="0" Grid.Row="1" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxPort" Grid.Column="1" Grid.Row="1" Margin="8"></TextBox> <TextBox x:Name="TextBoxPort" IsReadOnly="True" Grid.Column="1" Grid.Row="1" Margin="8"></TextBox>
<TextBlock Text="说明" Grid.Column="2" Grid.Row="1"></TextBlock> <TextBlock Text="说明" Grid.Column="2" Grid.Row="1"></TextBlock>
<TextBlock Text="用户ID(uuid)" Grid.Column="0" Grid.Row="2" Margin="8"></TextBlock> <TextBlock Text="用户ID(uuid)" Grid.Column="0" Grid.Row="2" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxUUID" Grid.Column="1" Grid.Row="2" Margin="8"></TextBox> <TextBox x:Name="TextBoxUUID" IsReadOnly="True" Grid.Column="1" Grid.Row="2" Margin="8"></TextBox>
<TextBlock Text="说明" Grid.Column="2" Grid.Row="2"></TextBlock> <TextBlock Text="说明" Grid.Column="2" Grid.Row="2"></TextBlock>
<TextBlock Text="加密方式" Grid.Column="0" Grid.Row="3" Margin="8"></TextBlock> <TextBlock Text="加密方式" Grid.Column="0" Grid.Row="3" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxEncryption" Grid.Column="1" Grid.Row="3" Margin="8"></TextBox> <TextBox x:Name="TextBoxEncryption" IsReadOnly="True" Grid.Column="1" Grid.Row="3" Margin="8"></TextBox>
<TextBlock Text="说明" Grid.Column="2" Grid.Row="3"></TextBlock> <TextBlock Text="说明" Grid.Column="2" Grid.Row="3"></TextBlock>
<TextBlock Text="传输协议" Grid.Column="0" Grid.Row="4" Margin="8"></TextBlock> <TextBlock Text="传输协议" Grid.Column="0" Grid.Row="4" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxTransmission" Grid.Column="1" Grid.Row="4" Margin="8"></TextBox> <TextBox x:Name="TextBoxTransmission" IsReadOnly="True" Grid.Column="1" Grid.Row="4" Margin="8"></TextBox>
<TextBlock Text="说明" Grid.Column="2" Grid.Row="4"></TextBlock> <TextBlock Text="说明" Grid.Column="2" Grid.Row="4"></TextBlock>
<TextBlock Text="伪装类型" Grid.Column="0" Grid.Row="5" Margin="8"></TextBlock> <TextBlock Text="伪装类型" Grid.Column="0" Grid.Row="5" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxCamouflageType" Grid.Column="1" Grid.Row="5" Margin="8"></TextBox> <TextBox x:Name="TextBoxCamouflageType" IsReadOnly="True" Grid.Column="1" Grid.Row="5" Margin="8"></TextBox>
<TextBlock Text="说明" Grid.Column="2" Grid.Row="5"></TextBlock> <TextBlock Text="说明" Grid.Column="2" Grid.Row="5"></TextBlock>
<TextBlock Text="路径(Path)" Grid.Column="0" Grid.Row="6" Margin="8"></TextBlock> <TextBlock Text="路径(Path)" Grid.Column="0" Grid.Row="6" Margin="8"></TextBlock>
<TextBox x:Name="TextBoxPath" Grid.Column="1" Grid.Row="6" Margin="8"></TextBox> <TextBox x:Name="TextBoxPath" IsReadOnly="True" Grid.Column="1" Grid.Row="6" Margin="8"></TextBox>
<TextBlock Text="说明" Grid.Column="2" Grid.Row="6"></TextBlock> <TextBlock Text="说明" Grid.Column="2" Grid.Row="6"></TextBlock>
<Button Content="确定" Grid.Column="1" Grid.Row="7" Grid.RowSpan="2" Margin="8"></Button> <TextBlock Text="以上参数可以手动输入客户端用于V2ray官方客户端的配置文件已经存放入config目录下点击确定可打开" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="2" TextWrapping="Wrap"></TextBlock>
<Button Content="取消" Grid.Column="2" Grid.Row="7" Grid.RowSpan="2" Margin="8"></Button> <Button Content="确定" Grid.Column="2" Grid.Row="7" Grid.RowSpan="2" Margin="20" Click="Button_Click"></Button>
</Grid> </Grid>
</GroupBox> </GroupBox>
</Grid> </Grid>

View File

@ -21,6 +21,54 @@ namespace ProxySU
public ResultClientInformation() public ResultClientInformation()
{ {
InitializeComponent(); InitializeComponent();
//主机地址
TextBoxHostAddress.Text = MainWindow.ReceiveConfigurationParameters[4];
//主机端口
TextBoxPort.Text = MainWindow.ReceiveConfigurationParameters[1];
//用户ID(uuid)
TextBoxUUID.Text = MainWindow.ReceiveConfigurationParameters[2];
//路径Path
TextBoxPath.Text = MainWindow.ReceiveConfigurationParameters[3];
//加密方式一般都为auto
TextBoxEncryption.Text = "auto";
//伪装类型
TextBoxCamouflageType.Text = MainWindow.ReceiveConfigurationParameters[5];
if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TCP"))
{
TextBoxTransmission.Text = "tcp";
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLS2Web"))
{
TextBoxTransmission.Text = "WebSocket(ws)";
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TCPhttp"))
{
TextBoxTransmission.Text = "tcp";
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "MkcpNone") || String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2SRTP") || String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPuTP") || String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WechatVideo") || String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2DTLS") || String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WireGuard"))
{
TextBoxTransmission.Text = "mKCP(kcp)";
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "HTTP2"))
{
TextBoxTransmission.Text = "h2";
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TLS"))
{
TextBoxTransmission.Text = "";
}
}
private void Button_Click(object sender, RoutedEventArgs e)
{
string openFolderPath = @"config";
System.Diagnostics.Process.Start("explorer.exe", openFolderPath);
this.Close();
} }
} }
} }

View File

@ -43,6 +43,7 @@ namespace ProxySU
{ {
//传递模板类型 //传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "TCPhttp"; MainWindow.ReceiveConfigurationParameters[0] = "TCPhttp";
MainWindow.ReceiveConfigurationParameters[5] = "http";
} }
else if (RadioButtonMkcpNoCamouflage.IsChecked == true) else if (RadioButtonMkcpNoCamouflage.IsChecked == true)
{ {

Binary file not shown.