1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-22 13:16:09 +03:00
This commit is contained in:
nuxt-autumn 2021-04-18 18:11:35 +08:00
parent 379edc265f
commit 41e3c85d01
15 changed files with 233 additions and 28 deletions

View File

@ -8,6 +8,10 @@ namespace ProxySU_Core.Models.Developers
{ {
int Port { get; set; } int Port { get; set; }
int VLESS_gRPC_Port { get; set; }
int VLESS_KCP_Port { get; set; }
int VMESS_KCP_Port { get; set; } int VMESS_KCP_Port { get; set; }
int ShadowSocksPort { get; set; } int ShadowSocksPort { get; set; }

View File

@ -316,6 +316,16 @@ namespace ProxySU_Core.Models.Developers
portList.Add(Parameters.VMESS_KCP_Port); portList.Add(Parameters.VMESS_KCP_Port);
} }
if (Parameters.Types.Contains(XrayType.VLESS_KCP))
{
portList.Add(Parameters.VLESS_KCP_Port);
}
if (Parameters.Types.Contains(XrayType.VLESS_gRPC))
{
portList.Add(Parameters.VLESS_gRPC_Port);
}
OpenPort(portList.ToArray()); OpenPort(portList.ToArray());
} }
@ -481,7 +491,8 @@ namespace ProxySU_Core.Models.Developers
SetPortFree(80); SetPortFree(80);
SetPortFree(443); SetPortFree(443);
SetPortFree(Parameters.Port); SetPortFree(Parameters.Port);
SetPortFree(Parameters.VMESS_KCP_Port); SetPortFree(Parameters.VLESS_gRPC_Port);
SetPortFree(Parameters.VLESS_KCP_Port);
SetPortFree(Parameters.ShadowSocksPort); SetPortFree(Parameters.ShadowSocksPort);
} }
} }

View File

@ -21,6 +21,7 @@ namespace ProxySU_Core.Models
case XrayType.VLESS_TCP_XTLS: case XrayType.VLESS_TCP_XTLS:
case XrayType.VLESS_WS: case XrayType.VLESS_WS:
case XrayType.VLESS_KCP: case XrayType.VLESS_KCP:
case XrayType.VLESS_gRPC:
case XrayType.Trojan_TCP: case XrayType.Trojan_TCP:
return BuildVlessShareLink(xrayType, settings); return BuildVlessShareLink(xrayType, settings);
case XrayType.VMESS_TCP: case XrayType.VMESS_TCP:
@ -99,7 +100,7 @@ namespace ProxySU_Core.Models
var _domain = settings.Domain; var _domain = settings.Domain;
var _port = settings.Port; var _port = settings.Port;
var _type = string.Empty; var _type = string.Empty;
var _encryption = string.Empty; var _encryption = "none";
var _security = "tls"; var _security = "tls";
var _path = "/"; var _path = "/";
var _host = settings.Domain; var _host = settings.Domain;
@ -112,21 +113,18 @@ namespace ProxySU_Core.Models
case XrayType.VLESS_TCP: case XrayType.VLESS_TCP:
_protocol = "vless"; _protocol = "vless";
_type = "tcp"; _type = "tcp";
_encryption = "none";
_descriptiveText = "vless-tcp-tls"; _descriptiveText = "vless-tcp-tls";
break; break;
case XrayType.VLESS_TCP_XTLS: case XrayType.VLESS_TCP_XTLS:
_protocol = "vless"; _protocol = "vless";
_type = "tcp"; _type = "tcp";
_security = "xtls"; _security = "xtls";
_encryption = "none";
_descriptiveText = "vless-tcp-xtls"; _descriptiveText = "vless-tcp-xtls";
break; break;
case XrayType.VLESS_WS: case XrayType.VLESS_WS:
_protocol = "vless"; _protocol = "vless";
_type = "ws"; _type = "ws";
_path = settings.VLESS_WS_Path; _path = settings.VLESS_WS_Path;
_encryption = "none";
_descriptiveText = "vless-ws-tls"; _descriptiveText = "vless-ws-tls";
break; break;
case XrayType.VLESS_KCP: case XrayType.VLESS_KCP:

View File

@ -27,6 +27,8 @@ namespace ProxySU_Core.Models
VLESS_WS_Path = "/vlessws"; VLESS_WS_Path = "/vlessws";
VLESS_H2_Path = "/vlessh2"; VLESS_H2_Path = "/vlessh2";
VLESS_KCP_Type = "none";
VLESS_KCP_Seed = guid;
VLESS_gRPC_ServiceName = "xray_gRPC"; VLESS_gRPC_ServiceName = "xray_gRPC";
VMESS_WS_Path = "/vmessws"; VMESS_WS_Path = "/vmessws";

View File

@ -153,6 +153,9 @@
<Compile Include="Views\ClientInfo\Trojan_TCP_Control.xaml.cs"> <Compile Include="Views\ClientInfo\Trojan_TCP_Control.xaml.cs">
<DependentUpon>Trojan_TCP_Control.xaml</DependentUpon> <DependentUpon>Trojan_TCP_Control.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\ClientInfo\VLESS_gRPC_Control.xaml.cs">
<DependentUpon>VLESS_gRPC_Control.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ClientInfo\VLESS_KCP_Control.xaml.cs"> <Compile Include="Views\ClientInfo\VLESS_KCP_Control.xaml.cs">
<DependentUpon>VLESS_KCP_Control.xaml</DependentUpon> <DependentUpon>VLESS_KCP_Control.xaml</DependentUpon>
</Compile> </Compile>
@ -295,7 +298,9 @@
<None Include="Templates\xray\server\05_inbounds\Trojan_WS.json"> <None Include="Templates\xray\server\05_inbounds\Trojan_WS.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="Templates\xray\server\05_inbounds\VLESS_gRPC.json" /> <None Include="Templates\xray\server\05_inbounds\VLESS_gRPC.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\xray\server\05_inbounds\VLESS_HTTP2.json"> <None Include="Templates\xray\server\05_inbounds\VLESS_HTTP2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
@ -361,6 +366,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Views\ClientInfo\VLESS_gRPC_Control.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ClientInfo\VLESS_KCP_Control.xaml"> <Page Include="Views\ClientInfo\VLESS_KCP_Control.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>

View File

@ -6,7 +6,8 @@
{ {
"id": "" "id": ""
} }
] ],
"decryption": "none"
}, },
"streamSettings": { "streamSettings": {
"network": "mkcp", "network": "mkcp",

View File

@ -16,4 +16,3 @@
} }
} }
} }
}

View File

@ -89,13 +89,21 @@ namespace ProxySU_Core.ViewModels
public string Domain public string Domain
{ {
get => settings.Domain; get => settings.Domain;
set => settings.Domain = value; set
{
settings.Domain = value;
Notify("Domain");
}
} }
public string MaskDomain public string MaskDomain
{ {
get => settings.MaskDomain; get => settings.MaskDomain;
set => settings.MaskDomain = value; set
{
settings.MaskDomain = value;
Notify("MaskDomain");
}
} }
public string TrojanPassword public string TrojanPassword
@ -283,7 +291,7 @@ namespace ProxySU_Core.ViewModels
set set
{ {
CheckBoxChanged(value, XrayType.VLESS_TCP_XTLS); CheckBoxChanged(value, XrayType.VLESS_TCP_XTLS);
Notify("Checked_VLESS_XTLS"); Notify("Checked_VLESS_TCP_XTLS");
} }
} }
public string VLESS_TCP_XTLS_ShareLink public string VLESS_TCP_XTLS_ShareLink

View File

@ -18,17 +18,19 @@
Style="{StaticResource MaterialDesignNavigatilRailTabControl}" Style="{StaticResource MaterialDesignNavigatilRailTabControl}"
Padding="10"> Padding="10">
<TabItem Width="200" <TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VLESS_XTLS}" IsEnabled="{Binding Settings.Checked_VLESS_TCP_XTLS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}" Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-TCP-XTLS"> Header="VLESS-TCP-XTLS">
<local:VLESS_XTLS_Control /> <local:VLESS_XTLS_Control />
</TabItem> </TabItem>
<TabItem Width="200" <TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VLESS_TCP}" IsEnabled="{Binding Settings.Checked_VLESS_TCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}" Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-TCP-TLS"> Header="VLESS-TCP-TLS">
<local:VLESS_TCP_TLS_Control /> <local:VLESS_TCP_TLS_Control />
</TabItem> </TabItem>
<TabItem Width="200" <TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VLESS_WS}" IsEnabled="{Binding Settings.Checked_VLESS_WS}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}" Style="{StaticResource MaterialDesignNavigationRailTabItem}"
@ -36,6 +38,19 @@
<local:VLESS_WS_TLS_Control /> <local:VLESS_WS_TLS_Control />
</TabItem> </TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VLESS_KCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-mKCP">
<local:VLESS_KCP_Control />
</TabItem>
<TabItem Width="200"
IsEnabled="{Binding Settings.Checked_VLESS_gRPC}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-gRPC">
<local:VLESS_gRPC_Control />
</TabItem>
</TabControl> </TabControl>
</TabItem> </TabItem>
@ -71,7 +86,7 @@
<TabItem Width="200" <TabItem Width="200"
IsEnabled="{Binding Settings.Checked_Trojan_TCP}" IsEnabled="{Binding Settings.Checked_Trojan_TCP}"
Style="{StaticResource MaterialDesignNavigationRailTabItem}" Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Header="VLESS-TCP-Trojan"> Header="Trojan-TCP">
<local:Trojan_TCP_Control /> <local:Trojan_TCP_Control />
</TabItem> </TabItem>
</TabControl> </TabControl>

View File

@ -33,7 +33,7 @@
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" /> <Label Content="伪装类型(type)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_Type}" IsReadOnly="True" Width="200" /> <TextBox Text="{Binding Settings.VLESS_KCP_Type}" IsReadOnly="True" Width="200" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
@ -43,7 +43,7 @@
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" /> <Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_Seed}" IsReadOnly="True" Width="200" /> <TextBox Text="{Binding Settings.VLESS_KCP_Seed}" IsReadOnly="True" Width="200" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
@ -53,7 +53,7 @@
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" /> <Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.VMESS_KCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" /> <TextBox Text="{Binding Settings.VLESS_KCP_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@ -48,7 +48,7 @@
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" /> <Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_TCP_Path}" IsReadOnly="True" Width="200" /> <TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal" Margin="0,10,0,0">

View File

@ -0,0 +1,64 @@
<UserControl x:Class="ProxySU_Core.Views.ClientInfo.VLESS_gRPC_Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySU_Core.Views.ClientInfo"
mc:Ignorable="d">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="地址(address)" Width="120" />
<TextBox Text="{Binding Settings.Domain}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="端口(port)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_gRPC_Port}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="用户ID(id)" Width="120" />
<TextBox Text="{Binding Settings.UUID}" IsReadOnly="True" Width="300" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="流控(flow)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="加密(encryption)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输协议(network)" Width="120" />
<TextBox Text="grpc" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装类型(type)" Width="120" />
<TextBox Text="none" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="伪装域名(host)" Width="120" />
<TextBox Text="" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="路径(path)" Width="120" />
<TextBox Text="{Binding Settings.VLESS_gRPC_ServiceName}" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="传输安全(tls)" Width="120" />
<TextBox Text="tls" IsReadOnly="True" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Label Content="分享链接" Width="120" />
<TextBox Text="{Binding Settings.VLESS_gRPC_ShareLink,Mode=OneTime}" Width="300" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</UserControl>

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySU_Core.Views.ClientInfo
{
/// <summary>
/// VLESS_gRPC_Control.xaml 的交互逻辑
/// </summary>
public partial class VLESS_gRPC_Control : UserControl
{
public VLESS_gRPC_Control()
{
InitializeComponent();
}
}
}

View File

@ -26,6 +26,7 @@
<RowDefinition Height="50" /> <RowDefinition Height="50" />
<RowDefinition Height="50" /> <RowDefinition Height="50" />
<RowDefinition Height="50" /> <RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!--XTLS--> <!--XTLS-->
@ -121,7 +122,7 @@
Width="260" /> Width="260" />
</StackPanel> </StackPanel>
<!--kcp port--> <!--seed-->
<StackPanel Margin="40,0,0,10" <StackPanel Margin="40,0,0,10"
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
@ -130,13 +131,44 @@
Binding Path=Settings.Checked_VLESS_KCP, Binding Path=Settings.Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter} Converter={StaticResource VisibleConverter}
}"> }">
<Label Content="KCP Seed" Width="70" VerticalAlignment="Bottom" />
<TextBox Text="{Binding Path=Settings.VLESS_KCP_Seed}" Width="260" VerticalAlignment="Bottom" />
</StackPanel>
<StackPanel Margin="40,0,0,10"
Grid.Row="5"
Grid.Column="1"
Orientation="Horizontal">
<!--kcp type-->
<StackPanel Margin="0,0,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="KCP伪装" Width="70" VerticalAlignment="Bottom"/>
<ComboBox Width="100"
VerticalAlignment="Bottom"
ItemsSource="{Binding Path=Settings.KcpTypes}"
SelectedValue="{Binding Settings.VLESS_KCP_Type,Mode=TwoWay}">
</ComboBox>
</StackPanel>
<!--kcp port-->
<StackPanel Margin="10,0,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="KCP端口" Width="70" VerticalAlignment="Bottom" /> <Label Content="KCP端口" Width="70" VerticalAlignment="Bottom" />
<TextBox Text="{Binding Path=Settings.VLESS_KCP_Port}" Width="100" VerticalAlignment="Bottom" /> <TextBox Text="{Binding Path=Settings.VLESS_KCP_Port}" Width="100" VerticalAlignment="Bottom" />
</StackPanel> </StackPanel>
</StackPanel>
<!--gRPC Port--> <!--gRPC Port-->
<StackPanel Margin="40,0,0,10" <StackPanel Margin="40,0,0,10"
Grid.Row="5" Grid.Row="6"
Grid.Column="1" Grid.Column="1"
Orientation="Horizontal" Orientation="Horizontal"
Visibility="{ Visibility="{
@ -153,7 +185,7 @@
<!--xray prot--> <!--xray prot-->
<StackPanel Margin="40,0,0,10" <StackPanel Margin="40,0,0,10"
Grid.Row="6" Grid.Row="7"
Grid.Column="1" Grid.Column="1"
Orientation="Horizontal"> Orientation="Horizontal">
<Label Content="Xray端口" Width="70" VerticalAlignment="Bottom" /> <Label Content="Xray端口" Width="70" VerticalAlignment="Bottom" />

View File

@ -106,7 +106,9 @@
Width="260" /> Width="260" />
</StackPanel> </StackPanel>
<!--kcp port-->
<!--seed-->
<StackPanel Margin="40,0,0,10" <StackPanel Margin="40,0,0,10"
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
@ -115,14 +117,46 @@
Binding Path=Settings.Checked_VMESS_KCP, Binding Path=Settings.Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter} Converter={StaticResource VisibleConverter}
}"> }">
<Label Content="KCP Seed" Width="70" VerticalAlignment="Bottom" />
<TextBox Text="{Binding Path=Settings.VMESS_KCP_Seed}" Width="260" VerticalAlignment="Bottom" />
</StackPanel>
<StackPanel Margin="40,0,0,10"
Grid.Row="5"
Grid.Column="1"
Orientation="Horizontal">
<!--kcp type-->
<StackPanel Margin="0,0,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="KCP伪装" Width="70" VerticalAlignment="Bottom"/>
<ComboBox Width="100"
VerticalAlignment="Bottom"
ItemsSource="{Binding Path=Settings.KcpTypes}"
SelectedValue="{Binding Settings.VMESS_KCP_Type,Mode=TwoWay}">
</ComboBox>
</StackPanel>
<!--kcp port-->
<StackPanel Margin="10,0,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Settings.Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="KCP端口" Width="70" VerticalAlignment="Bottom" /> <Label Content="KCP端口" Width="70" VerticalAlignment="Bottom" />
<TextBox Text="{Binding Path=Settings.VMESS_KCP_Port}" Width="100" VerticalAlignment="Bottom" /> <TextBox Text="{Binding Path=Settings.VMESS_KCP_Port}" Width="100" VerticalAlignment="Bottom" />
</StackPanel> </StackPanel>
</StackPanel>
<!--xray prot--> <!--xray prot-->
<StackPanel Margin="40,0,0,10" <StackPanel Margin="40,0,0,10"
Grid.Row="5" Grid.Row="6"
Grid.Column="1" Grid.Column="1"
Orientation="Horizontal"> Orientation="Horizontal">
<Label Content="Xray端口" Width="70" VerticalAlignment="Bottom" /> <Label Content="Xray端口" Width="70" VerticalAlignment="Bottom" />