1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-25 22:56:09 +03:00

增加http2(自签证书)模式

This commit is contained in:
ProxySU 2020-04-16 21:43:53 +08:00
parent c694dede84
commit e498e7bec8
7 changed files with 120 additions and 13 deletions

View File

@ -234,6 +234,11 @@ namespace ProxySU
serverConfig = "TemplateConfg\\http2Web_server_config.json"; serverConfig = "TemplateConfg\\http2Web_server_config.json";
clientConfig = "TemplateConfg\\http2Web_client_config.json"; clientConfig = "TemplateConfg\\http2Web_client_config.json";
} }
else if (String.Equals(ReceiveConfigurationParameters[0], "http2selfSigned"))
{
serverConfig = "TemplateConfg\\http2selfSigned_server_config.json";
clientConfig = "TemplateConfg\\http2selfSigned_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 (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")) else if (ReceiveConfigurationParameters[0].Contains("mKCP"))
{ {

View File

@ -144,9 +144,13 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<RadioButton x:Name="RadioButtonHTTP2" Content="HTTP2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonHTTP2_Checked"></RadioButton> <RadioButton x:Name="RadioButtonHTTP2" Content="HTTP2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonHTTP2_Checked"></RadioButton>
<TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现,需要域名" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonHTTP2Web" Content="HTTP2+TLS+Web" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton> <RadioButton x:Name="RadioButtonHTTP2Web" Content="HTTP2+TLS+Web" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
<TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现,增加伪装网站" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock> <TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现,增加伪装网站,需要域名" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButtonHTTP2selfSigned" Content="HTTP2(自签证书)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonWebSocketTLSselfSigned_Checked"></RadioButton>
<TextBlock Text="基于 HTTP/2 的传输方式。它完整按照 HTTP/2 标准实现,可以不需要域名。" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
<TextBlock Text="Shadowrocket (ios)需要手动打开“允许不安全”选项" TextWrapping="Wrap" Grid.Column="4" Grid.Row="3" ></TextBlock>
</Grid> </Grid>
</TabItem> </TabItem>

View File

@ -110,17 +110,7 @@ namespace ProxySU
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString(); MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
} }
//WebSocket+TLS(自签证书)模式被选中
else if (RadioButtonWebSocketTLSselfSigned.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLSselfSigned";
//传递路径
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
//传递域名
//MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
}
//WebSocket+TLS+Web模式被选中 //WebSocket+TLS+Web模式被选中
else if (RadioButtonWebSocketTLS2Web.IsChecked == true|| RadioButtonWebSocketTLS2WebHot.IsChecked==true) else if (RadioButtonWebSocketTLS2Web.IsChecked == true|| RadioButtonWebSocketTLS2WebHot.IsChecked==true)
{ {
@ -152,6 +142,17 @@ namespace ProxySU
} }
} }
} }
//WebSocket+TLS(自签证书)模式被选中
else if (RadioButtonWebSocketTLSselfSigned.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLSselfSigned";
//传递路径
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
//传递域名
//MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
}
//http2模式被选中 //http2模式被选中
else if (RadioButtonHTTP2.IsChecked == true) else if (RadioButtonHTTP2.IsChecked == true)
{ {
@ -199,6 +200,17 @@ namespace ProxySU
} }
} }
} }
//WebSocket+TLS(自签证书)模式被选中
else if (RadioButtonWebSocketTLSselfSigned.IsChecked == true)
{
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "http2selfSigned";
//传递路径
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
//传递域名
//MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
}
//mKCP无伪装模式被选中 //mKCP无伪装模式被选中
else if (RadioButtonMkcpNoCamouflage.IsChecked == true) else if (RadioButtonMkcpNoCamouflage.IsChecked == true)
{ {

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,52 @@
{
"inbounds": [
{
"protocol": "http",
"port": 1081
},
{
"port": 1080,
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "noauth"
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": null,
"port": null,
"users": [
{
"id": null,
"alterId": 16,
"security": "auto"
}
]
}
]
},
"streamSettings": {
"network": "h2",
"security": "tls",
"httpSettings": {
"path": null
},
"tlsSettings": {
"allowInsecure": true
}
}
}
]
}

View File

@ -0,0 +1,34 @@
{
"inbounds": [
{
"port": null,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": null,
"alterId": 64
}
]
},
"streamSettings": {
"network": "h2",
"security": "tls",
"tlsSettings": {
"certificates": [
{}
]
},
"httpSettings": {
"path": null
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}