mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-03-27 10:33:59 +03:00
增加tcp+TLS(自签证书)
This commit is contained in:
parent
ec88a916d2
commit
8a2dbd5c2c
@ -189,25 +189,35 @@ namespace ProxySU
|
||||
serverConfig = "TemplateConfg\\tcp_server_config.json";
|
||||
clientConfig = "TemplateConfg\\tcp_client_config.json";
|
||||
}
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "TCPhttp"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\tcp_http_server_config.json";
|
||||
clientConfig = "TemplateConfg\\tcp_http_client_config.json";
|
||||
}
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLS"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\tcp_TLS_server_config.json";
|
||||
clientConfig = "TemplateConfg\\tcp_TLS_client_config.json";
|
||||
}
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLSselfSigned"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\tcpTLSselfSigned_server_config.json";
|
||||
clientConfig = "TemplateConfg\\tcpTLSselfSigned_client_config.json";
|
||||
}
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\WebSocket_TLS_server_config.json";
|
||||
clientConfig = "TemplateConfg\\WebSocket_TLS_client_config.json";
|
||||
}
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS2Web"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\WebSocketTLSWeb_server_config.json";
|
||||
clientConfig = "TemplateConfg\\WebSocketTLSWeb_client_config.json";
|
||||
}
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "WebSocketTLS"))
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "Http2"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\WebSocketTLS_server_config.json";
|
||||
clientConfig = "TemplateConfg\\WebSocketTLS_client_config.json";
|
||||
}
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "tcpTLS"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\tcpTLS_server_config.json";
|
||||
clientConfig = "TemplateConfg\\tcpTLS_client_config.json";
|
||||
}
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "TCPhttp"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\tcp_http_server_config.json";
|
||||
clientConfig = "TemplateConfg\\tcp_http_client_config.json";
|
||||
serverConfig = "TemplateConfg\\http2_server_config.json";
|
||||
clientConfig = "TemplateConfg\\http2_client_config.json";
|
||||
}
|
||||
//else if (String.Equals(ReceiveConfigurationParameters[0], "MkcpNone")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2SRTP")||String.Equals(ReceiveConfigurationParameters[0], "mKCPuTP")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2WechatVideo")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2DTLS")|| String.Equals(ReceiveConfigurationParameters[0], "mKCP2WireGuard"))
|
||||
else if (ReceiveConfigurationParameters[0].Contains("mKCP"))
|
||||
@ -215,12 +225,7 @@ namespace ProxySU
|
||||
serverConfig = "TemplateConfg\\mkcp_server_config.json";
|
||||
clientConfig = "TemplateConfg\\mkcp_client_config.json";
|
||||
}
|
||||
|
||||
else if (String.Equals(ReceiveConfigurationParameters[0], "Http2"))
|
||||
{
|
||||
serverConfig = "TemplateConfg\\http2_server_config.json";
|
||||
clientConfig = "TemplateConfg\\http2_client_config.json";
|
||||
}
|
||||
|
||||
// else if (String.Equals(ReceiveConfigurationParameters[0], "QuicNone") || String.Equals(ReceiveConfigurationParameters[0], "QuicSRTP") || String.Equals(ReceiveConfigurationParameters[0], "Quic2uTP") || String.Equals(ReceiveConfigurationParameters[0], "QuicWechatVideo") || String.Equals(ReceiveConfigurationParameters[0], "QuicDTLS") || String.Equals(ReceiveConfigurationParameters[0], "QuicWireGuard"))
|
||||
else if (ReceiveConfigurationParameters[0].Contains("Quic"))
|
||||
{
|
||||
@ -645,6 +650,13 @@ namespace ProxySU
|
||||
{
|
||||
serverJson["inbounds"][0]["port"] = ReceiveConfigurationParameters[1];
|
||||
}
|
||||
//tcp+TLS自签证书模式下
|
||||
if (serverConfig.Contains("tcpTLSselfSigned") == true)
|
||||
{
|
||||
string selfSignedCa = client.RunCommand("/usr/bin/v2ray/v2ctl cert --ca").Result;
|
||||
JObject selfSignedCaJObject = JObject.Parse(selfSignedCa);
|
||||
serverJson["inbounds"][0]["streamSettings"]["tlsSettings"]["certificates"][0] = selfSignedCaJObject;
|
||||
}
|
||||
//如果是WebSocketTLSWeb模式,则设置路径
|
||||
if (serverConfig.Contains("WebSocket") == true)
|
||||
{
|
||||
@ -758,10 +770,10 @@ namespace ProxySU
|
||||
|
||||
|
||||
//启动Caddy服务
|
||||
client.RunCommand("caddy -service start");
|
||||
client.RunCommand("caddy -service restart");
|
||||
}
|
||||
|
||||
if (serverConfig.Contains("http2") == true|| serverConfig.Contains("WebSocketTLS")==true|| serverConfig.Contains("tcpTLS") == true)
|
||||
if (serverConfig.Contains("http2") == true|| serverConfig.Contains("WebSocket_TLS") ==true|| serverConfig.Contains("tcp_TLS") == true)
|
||||
{
|
||||
currentStatus = "使用Http2/WebSocket +TLS/tcp+TLS模式,正在安装acme.sh......";
|
||||
textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
|
||||
|
@ -64,6 +64,14 @@ namespace ProxySU
|
||||
HidePathAndTLS();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "tcpTLSselfSigned"))
|
||||
{
|
||||
TextBoxTransmission.Text = "tcp";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "tls";
|
||||
HidePathAndTLS();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "MkcpNone"))
|
||||
{
|
||||
TextBoxTransmission.Text = "kcp";
|
||||
|
@ -89,8 +89,9 @@
|
||||
<TextBlock Text="数据加密传输,并做http伪装,会被识别为http流量,但并不是真正的http访问" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonTCP2TLS" Content="TCP+TLS" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCP2TLS_Checked" />
|
||||
<TextBlock Text="数据加密传输,传输协议使用TLS,会被识别为TLS流量,不等同于https流量特征 (需要域名)" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonTCP2TLSnoDomain" Content="TCP+TLS((自签证书)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP2TLSnoDomain_Checked" />
|
||||
<RadioButton x:Name="RadioButtonTcpTLS2SelfSigned" Content="TCP+TLS((自签证书)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP2TLSnoDomain_Checked" />
|
||||
<TextBlock Text="数据加密传输,传输协议使用TLS,会被识别为TLS流量,不等同于https流量特征 (无需域名)" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
|
||||
<TextBlock Text="Shadowrocket (ios)需要手动打开“允许不安全”选项" TextWrapping="Wrap" Grid.Column="4" Grid.Row="4" ></TextBlock>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
@ -76,6 +76,16 @@ namespace ProxySU
|
||||
//传递域名
|
||||
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
|
||||
}
|
||||
//tcp+TLS(自签证书)模式被选中
|
||||
else if (RadioButtonTcpTLS2SelfSigned.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "tcpTLSselfSigned";
|
||||
|
||||
//传递域名
|
||||
// MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
|
||||
}
|
||||
//WebSocket+TLS模式被选中
|
||||
else if (RadioButtonWebSocketTLS.IsChecked == true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user