mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-04-09 20:21:02 +00:00
Compare commits
No commits in common. "master" and "v1.4.0" have entirely different histories.
327 changed files with 35516 additions and 16216 deletions
|
@ -1,4 +0,0 @@
|
|||
[*.cs]
|
||||
|
||||
# Default severity for all analyzer diagnostics
|
||||
dotnet_analyzer_diagnostic.severity = none
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -13,7 +13,7 @@
|
|||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
# [Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
|
@ -198,5 +198,3 @@ FakesAssemblies/
|
|||
|
||||
# vs code
|
||||
.vscode/*
|
||||
/ProxySU_Core/Data/Record.json
|
||||
/ProxySuper.WPF/bin
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
32
.idea/.idea.ProxySU/.idea/contentModel.xml
generated
32
.idea/.idea.ProxySU/.idea/contentModel.xml
generated
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ContentModelStore">
|
||||
<e p="C:\Users\huife\AppData\Local\JetBrains\Rider2020.2\extResources" t="IncludeRecursive" />
|
||||
<e p="C:\Users\huife\AppData\Local\JetBrains\Rider2020.2\resharper-host\Local\Transient\Rider\v202\SolutionCaches\_ProxySU.1010492592.00" t="ExcludeRecursive" />
|
||||
<e p="E:\dev\ProxySU" t="IncludeFlat">
|
||||
<e p="packages" t="ExcludeRecursive" />
|
||||
<e p="ProxySU" t="IncludeRecursive">
|
||||
<e p="ProxySU.csproj" t="IncludeRecursive" />
|
||||
</e>
|
||||
<e p="ProxySU.sln" t="IncludeFlat" />
|
||||
<e p="WpfApp1" t="IncludeRecursive">
|
||||
<e p="App.xaml" t="Include" />
|
||||
<e p="App.xaml.cs" t="Include" />
|
||||
<e p="AssemblyInfo.cs" t="Include" />
|
||||
<e p="bin" t="ExcludeRecursive" />
|
||||
<e p="MainWindow.xaml" t="Include" />
|
||||
<e p="MainWindow.xaml.cs" t="Include" />
|
||||
<e p="obj" t="ExcludeRecursive">
|
||||
<e p="Debug" t="Include">
|
||||
<e p="netcoreapp3.1-windows" t="Include">
|
||||
<e p="App.g.cs" t="Include" />
|
||||
<e p="MainWindow.g.cs" t="Include" />
|
||||
<e p="WpfApp1.AssemblyInfo.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
</e>
|
||||
<e p="WpfApp1.csproj" t="IncludeRecursive" />
|
||||
</e>
|
||||
</e>
|
||||
</component>
|
||||
</project>
|
4
.idea/.idea.ProxySU/.idea/encodings.xml
generated
4
.idea/.idea.ProxySU/.idea/encodings.xml
generated
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
8
.idea/.idea.ProxySU/.idea/indexLayout.xml
generated
8
.idea/.idea.ProxySU/.idea/indexLayout.xml
generated
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ContentModelUserStore">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
8
.idea/.idea.ProxySU/.idea/modules.xml
generated
8
.idea/.idea.ProxySU/.idea/modules.xml
generated
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.ProxySU/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.ProxySU/riderModule.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="vcsConfiguration" value="2" />
|
||||
</component>
|
||||
</project>
|
6
.idea/.idea.ProxySU/.idea/vcs.xml
generated
6
.idea/.idea.ProxySU/.idea/vcs.xml
generated
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
121
.idea/.idea.ProxySU/.idea/workspace.xml
generated
121
.idea/.idea.ProxySU/.idea/workspace.xml
generated
|
@ -1,121 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoGeneratedRunConfigurationManager">
|
||||
<projectFile>ProxySU/ProxySU.csproj</projectFile>
|
||||
<projectFile>WpfApp1/WpfApp1.csproj</projectFile>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="669dc0ab-dc83-4456-b675-b70a2f5f75b2" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/ProxySU.sln" beforeDir="false" afterPath="$PROJECT_DIR$/ProxySU.sln" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ProxySU/bin/Beta/Beta.zip" beforeDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="file://$PROJECT_DIR$/ProxySU/MainWindow.xaml" root0="SKIP_HIGHLIGHTING" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/WpfApp1/MainWindow.xaml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectId" id="1lRuJq6UGgT2UlI6dsaBIqwjatG" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="dart.analysis.tool.window.visible" value="false" />
|
||||
<property name="vue.rearranger.settings.migration" value="true" />
|
||||
</component>
|
||||
<component name="RunManager" selected=".NET Project.WpfApp1">
|
||||
<configuration name="ProxySU" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/ProxySU/ProxySU.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="Console" />
|
||||
<option name="PROJECT_TFM" value="" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="WpfApp1" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/WpfApp1/WpfApp1.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value="" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="669dc0ab-dc83-4456-b675-b70a2f5f75b2" name="Default Changelist" comment="" />
|
||||
<created>1607572158648</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1607572158648</updated>
|
||||
<workItem from="1607572166623" duration="517000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="UnityProjectConfiguration" hasMinimizedUI="null" />
|
||||
<component name="UnityUnitTestConfiguration" currentTestLauncher="NUnit" />
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||
</component>
|
||||
<component name="WindowStateProjectService">
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.bottom" timestamp="1607572691215">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1607572691215" />
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.center" timestamp="1607572691215">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1607572691215" />
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.left" timestamp="1607572691215">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1607572691215" />
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.right" timestamp="1607572691215">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1607572691215" />
|
||||
<state x="552" y="252" key="Rider.ProjectTemplateDialog.Size" timestamp="1607572543584">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="552" y="252" key="Rider.ProjectTemplateDialog.Size/0.0.1920.1040@0.0.1920.1040" timestamp="1607572543584" />
|
||||
</component>
|
||||
</project>
|
7
.idea/.idea.ProxySU/riderModule.iml
generated
7
.idea/.idea.ProxySU/riderModule.iml
generated
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="RIDER_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$/../.." />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
26
ProxySU.sln
26
ProxySU.sln
|
@ -1,13 +1,9 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31606.5
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1022
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libs", "Libs", "{CE908112-DB46-4B91-8236-9139A19D66E9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxySuper.WPF", "ProxySuper.WPF\ProxySuper.WPF.csproj", "{B083EBFD-2925-46C9-8B00-E2C1300CEBA1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxySuper.Core", "ProxySuper.Core\ProxySuper.Core.csproj", "{15779EE6-D8CA-44BF-BFE2-941E155EEF3F}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxySU", "ProxySU\ProxySU.csproj", "{DD5505BC-E7F1-4D03-ABC7-B636E893FC09}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -15,22 +11,14 @@ Global
|
|||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B083EBFD-2925-46C9-8B00-E2C1300CEBA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B083EBFD-2925-46C9-8B00-E2C1300CEBA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B083EBFD-2925-46C9-8B00-E2C1300CEBA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B083EBFD-2925-46C9-8B00-E2C1300CEBA1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{15779EE6-D8CA-44BF-BFE2-941E155EEF3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{15779EE6-D8CA-44BF-BFE2-941E155EEF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{15779EE6-D8CA-44BF-BFE2-941E155EEF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{15779EE6-D8CA-44BF-BFE2-941E155EEF3F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DD5505BC-E7F1-4D03-ABC7-B636E893FC09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DD5505BC-E7F1-4D03-ABC7-B636E893FC09}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DD5505BC-E7F1-4D03-ABC7-B636E893FC09}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DD5505BC-E7F1-4D03-ABC7-B636E893FC09}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{B083EBFD-2925-46C9-8B00-E2C1300CEBA1} = {CE908112-DB46-4B91-8236-9139A19D66E9}
|
||||
{15779EE6-D8CA-44BF-BFE2-941E155EEF3F} = {CE908112-DB46-4B91-8236-9139A19D66E9}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A3F3B8D6-7FED-42D9-9994-E913BD32E025}
|
||||
EndGlobalSection
|
||||
|
|
9
ProxySU/App.xaml
Normal file
9
ProxySU/App.xaml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<Application x:Class="ProxySU.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
16
ProxySU/App.xaml.cs
Normal file
16
ProxySU/App.xaml.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySU
|
||||
{
|
||||
/// <summary>
|
||||
/// App.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
293
ProxySU/MainWindow.xaml
Normal file
293
ProxySU/MainWindow.xaml
Normal file
|
@ -0,0 +1,293 @@
|
|||
<Window x:Class="ProxySU.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
mc:Ignorable="d"
|
||||
Title="ProxySU" Height="600" Width="900">
|
||||
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
|
||||
https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
|
||||
<Window.Resources>
|
||||
<Style BasedOn="{StaticResource {x:Type TextBox}}"
|
||||
TargetType="TextBox"
|
||||
x:Key="TitleText">
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Text" Value=""/>
|
||||
<Condition Property="TextBox.IsFocused" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="Gray" Margin="0">
|
||||
<TextBlock x:Name="MainTextBlock" Text="{TemplateBinding TextBox.Tag}" Width="{TemplateBinding TextBox.ActualWidth}" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</MultiTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<TabControl>
|
||||
<!--<TabItem Header="V2ray配置生成器" Width="110" Height="30">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>-->
|
||||
<TabItem Header="应用布署" Width="110" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="80"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="40"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30" ></RowDefinition>
|
||||
<RowDefinition ></RowDefinition>
|
||||
<RowDefinition ></RowDefinition>
|
||||
<RowDefinition Height="60"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="主机名" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="0"></TextBlock>
|
||||
<TextBlock Text="端口" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="0"></TextBlock>
|
||||
<TextBox x:Name="TextBoxHost" Text="" Style="{StaticResource TitleText}" Tag="IP或域名(不可为空)" Margin="5" Grid.Column="1" Grid.Row="0"></TextBox>
|
||||
<TextBox x:Name="TextBoxPort" CommandManager.PreviewExecuted="TextBoxPort_PreviewExecuted" Text="22" Margin="5" Grid.Column="3" Grid.Row="0" PreviewTextInput="TextBoxPort_PreviewTextInput"/>
|
||||
<TextBlock Text="用户名:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="1"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockPassword" Text="密码:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxUserName" Text="root" Margin="5" Grid.Column="1" Grid.Row="1"></TextBox>
|
||||
<PasswordBox x:Name="PasswordBoxHostPassword" Password="" Margin="5" Grid.Column="3" Grid.Row="1"></PasswordBox>
|
||||
<RadioButton x:Name="RadioButtonPasswordLogin" GroupName="CertIsYesNo" Content="密码登录" Grid.Column="0" Grid.Row="2" Checked="RadioButtonPasswordLogin_Checked"></RadioButton>
|
||||
<RadioButton x:Name="RadioButtonCertLogin" GroupName="CertIsYesNo" Content="密钥登录" Grid.Column="1" Grid.Row="2" Checked="RadioButtonCertLogin_Checked"></RadioButton>
|
||||
<Button x:Name="ButtonOpenFileDialog" Content="浏览..." Margin="8" Grid.Column="2" Grid.Row="2" Click="ButtonOpenFileDialog_Click"></Button>
|
||||
<TextBox x:Name="TextBoxCertFilePath" Text="" Style="{StaticResource TitleText}" Tag="密钥文件存放路径(不可为空)" Margin="10" Grid.Column="3" Grid.Row="2"></TextBox>
|
||||
<!--代理设置-->
|
||||
<Grid Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton x:Name="RadioButtonNoProxy" GroupName="ProxyIsYesNo" Content="无代理" Grid.Column="0" Grid.Row="0" Checked="RadioButtonNoProxy_Checked" Unchecked="RadioButtonNoProxy_Unchecked"/>
|
||||
<RadioButton x:Name="RadioButtonHttp" GroupName="ProxyIsYesNo" Content="Http代理" Grid.Column="1" Grid.Row="0"/>
|
||||
|
||||
<RadioButton x:Name="RadioButtonSocks5" GroupName="ProxyIsYesNo" Content="Socks5代理" Grid.Column="2" Grid.Row="0"/>
|
||||
<RadioButton x:Name="RadioButtonSocks4" GroupName="ProxyIsYesNo" Content="Socks4代理" Grid.Column="3" Grid.Row="0" />
|
||||
</Grid>
|
||||
|
||||
<TextBlock x:Name="TextBlockProxyHost" IsEnabled="False" Text="代理地址" HorizontalAlignment="Left" Margin="5,10,0,5" Grid.Column="0" Grid.Row="4"/>
|
||||
<TextBlock x:Name="TextBlockProxyPort" IsEnabled="False" Text="端口" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="4"></TextBlock>
|
||||
<TextBox x:Name="TextBoxProxyHost" IsEnabled="False" Text="127.0.0.1" Margin="5" Grid.Column="1" Grid.Row="4"></TextBox>
|
||||
<TextBox x:Name="TextBoxProxyPort" IsEnabled="False" CommandManager.PreviewExecuted="TextBoxPort_PreviewExecuted" Text="1080" Margin="5" Grid.Column="3" Grid.Row="4" PreviewTextInput="TextBoxPort_PreviewTextInput"/>
|
||||
<!--代理用户名密码设置-->
|
||||
<RadioButton x:Name="RadioButtonProxyNoLogin" Content="不需登录" GroupName="proxyYesNOLogin" Grid.Column="0" Grid.Row="5" Checked="RadioButtonProxyNoLogin_Checked"></RadioButton>
|
||||
<RadioButton x:Name="RadiobuttonProxyYesLogin" Content="需要登录" GroupName="proxyYesNOLogin" Grid.Column="1" Grid.Row="5" Checked="RadiobuttonProxyYesLogin_Checked"></RadioButton>
|
||||
<TextBlock x:Name="TextBlockProxyUser" IsEnabled="False" Text="用户名:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="6"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockProxyPassword" IsEnabled="False" Text="密码:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="6"></TextBlock>
|
||||
<TextBox x:Name="TextBoxProxyUserName" IsEnabled="False" Text="" Margin="5" Grid.Column="1" Grid.Row="6"></TextBox>
|
||||
<PasswordBox x:Name="PasswordBoxProxyPassword" IsEnabled="False" Password="" Margin="5" Grid.Column="3" Grid.Row="6"></PasswordBox>
|
||||
|
||||
<!--<StatusBar x:Name="StatusBarStatusMonitoring" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="4"></StatusBar>-->
|
||||
<TextBlock x:Name="TextBlockSetUpProcessing" Text="等待安装布署" Foreground="Blue" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="4"></TextBlock>
|
||||
<ProgressBar x:Name="ProgressBarSetUpProcessing" Minimum="0" Maximum="100" Value="0" IsIndeterminate="False" Margin="7" Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="4"></ProgressBar>
|
||||
<TabControl Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="4" Grid.RowSpan="3">
|
||||
<TabItem Header="V2ray" Width="100" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<!--<Button x:Name="ButtonGuideConfiguration" Visibility="Visible" Content="启用向导" Grid.Column="0" Grid.Row="0" Click="ButtonGuideConfiguration_Click"></Button>
|
||||
<TextBlock Text="通过向导生成配置文件" Visibility="Visible" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>-->
|
||||
<Button x:Name="ButtonTemplateConfiguration" Content="模板库" Grid.Column="1" Grid.Row="0" Margin="5" Click="ButtonTemplateConfiguration_Click"></Button>
|
||||
<TextBlock Text="模板库" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
|
||||
<!--<Button x:Name="ButtonAdvancedConfiguration" Visibility="Visible" Content="配置编辑器" Grid.Column="2" Grid.Row="0" Click="ButtonAdvancedConfiguration_Click"></Button>
|
||||
<TextBlock Text="配置文件高级生成器
(有经验用户可以使用)" Visibility="Visible" Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>-->
|
||||
<!--<RadioButton x:Name="RadioButtonGuideConfiguration" Content="向导生成配置" Grid.Column="0" Grid.Row="0"></RadioButton>
|
||||
<RadioButton x:Name="RadioButtonTemplateConfiguration" Content="模板配置" Grid.Column="0" Grid.Row="1"></RadioButton>
|
||||
<RadioButton x:Name="RadioButtonAdvancedConfiguration" Content="高级配置" Grid.Column="0" Grid.Row="2"></RadioButton>
|
||||
<TextBox x:Name="TextBoxJsonPath" Margin="10" Grid.Column="1" Grid.Row="1"></TextBox>
|
||||
<Button x:Name="ButtonSetConfiguration" Margin="6" Content="配置" Grid.Column="2" Grid.Row="2" Click="ButtonSetConfiguration_Click"></Button>-->
|
||||
<Button x:Name="Button_Login" Content="V2ray一键安装" Grid.ColumnSpan="1" Margin="10" Grid.Column="0" Grid.Row="2" Click="Button_Login_Click"></Button>
|
||||
<Button x:Name="Button_canel" Content="取消" Grid.ColumnSpan="1" Margin="10" Grid.Column="2" Grid.Row="2" Click="Button_canel_Click"></Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Trojan" Width="100" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="ButtonTrojanTemplate" Content="Trojan设置" Grid.Column="1" Grid.Row="0" Margin="5" Click="ButtonTrojanTemplate_Click"/>
|
||||
<TextBlock Text="Trojan参数设置" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
|
||||
|
||||
<Button x:Name="ButtonTrojanSetUp" Content="Trojan一键安装" Grid.ColumnSpan="1" Margin="10" Grid.Column="0" Grid.Row="2" Click="ButtonTrojanSetUp_Click"/>
|
||||
<Button x:Name="ButtonTrojanCancel" Content="取消" Grid.ColumnSpan="1" Margin="10" Grid.Column="2" Grid.Row="2" Click="Button_canel_Click"></Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem x:Name="TabItemNaiveProxy" Header="NaiveProxy" Width="100" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Header="参数设置" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Grid.RowSpan="2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.4*"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="0.3*"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="模式:NaiveProxy+TLS+Caddy" Grid.Column="1" Grid.Row="0"></TextBlock>
|
||||
<TextBlock Text="服务器地址(域名):" Grid.Column="0" Grid.Row="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxNaiveHostDomain" Style="{StaticResource TitleText}" Tag="域名不可为空" Grid.Column="1" Grid.Row="1" Margin="3"></TextBox>
|
||||
<TextBlock Text="端口:443" Grid.Column="2" Grid.Row="1"></TextBlock>
|
||||
<TextBlock Text="用户名:" Grid.Column="0" Grid.Row="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxNaiveUser" Grid.Column="1" Grid.Row="2" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonNaiveUser" Content="随机" Grid.Column="2" Grid.Row="2" Margin="2" Click="ButtonNaiveUser_Click"></Button>
|
||||
<TextBlock Text="密码:" Grid.Column="0" Grid.Row="3"></TextBlock>
|
||||
<TextBox x:Name="TextBoxNaivePassword" Grid.Column="1" Grid.Row="3" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonNaivePassword" Content="更新" Grid.Column="2" Grid.Row="3" Margin="2" Click="ButtonNaivePassword_Click"></Button>
|
||||
<TextBlock Text="伪装网站:" Grid.Column="0" Grid.Row="4"></TextBlock>
|
||||
<TextBox x:Name="TextBoxNaiveSites" Style="{StaticResource TitleText}" Tag="可以增加代理的隐蔽(可为空)" Grid.Column="1" Grid.Row="4" Margin="3"></TextBox>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--<Button x:Name="ButtonNaiveTemplate" Content="Naive设置" Grid.Column="1" Grid.Row="0" Margin="5" Click="ButtonTrojanTemplate_Click"/>
|
||||
<TextBlock Text="Naive参数设置" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>-->
|
||||
|
||||
<Button x:Name="ButtonNavieSetUp" Content="NaiveProxy一键安装" Grid.ColumnSpan="1" Margin="10" Grid.Column="0" Grid.Row="2" Click="ButtonNavieSetUp_Click"/>
|
||||
<Button x:Name="ButtonNaiveCancel" Content="取消" Grid.ColumnSpan="1" Margin="10" Grid.Column="2" Grid.Row="2" Click="Button_canel_Click"></Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="系统工具" Width="100" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="ButtonProofreadTime" Content="校对时间" Grid.Column="0" Grid.Row="0" Margin="5" Click="ButtonProofreadTime_Click"/>
|
||||
<Button x:Name="ButtonClearOccupiedPorts" Content="释放80/443端口" Grid.Column="1" Grid.Row="0" Margin="5" Click="ButtonClearOccupiedPorts_Click"></Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<!--<TabItem Header="测试面板" Visibility="Visible" Width="150" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="ButtonTestTrojanClientInfoWin" Content="测试Trojan结果窗口" Click="ButtonTestTrojanClientInfoWin_Click"></Button>
|
||||
</Grid>
|
||||
</TabItem>-->
|
||||
</TabControl>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="资源工具" Width="110" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="ButtonWebBrowserHomePage" Content="主页" Grid.Column="0" Grid.Row="0" Margin="5" Click="ButtonWebBrowserHomePage_Click"></Button>
|
||||
<Button x:Name="ButtonWebBrowserForward" Content="前进" Grid.Column="2" Grid.Row="0" Margin="5" Click="ButtonWebBrowserForward_Click"></Button>
|
||||
<Button x:Name="ButtonWebBrowserBack" Content="后退" Grid.Column="1" Grid.Row="0" Margin="5" Click="ButtonWebBrowserBack_Click"/>
|
||||
<TextBlock Text="由于众所周知的原因,在某些时候,加载缓慢,请耐心等待一下" Grid.Column="4" Grid.Row="0" Grid.ColumnSpan="4" Margin="5"></TextBlock>
|
||||
<!--<TextBox x:Name="TextBoxWebBrowserProxyUrl" Style="{StaticResource TitleText}" Tag="粘贴被墙的网址到这里点击 GO(下面被墙网址右击==复制快捷方式)" Grid.Column="3" Grid.Row="0" Grid.ColumnSpan="5" Margin="5"></TextBox>
|
||||
<Button x:Name="ButtonWebBrowserProxyGo" Content="Go" Grid.Column="8" Grid.Row="0" Margin="5" Click="ButtonWebBrowserProxyGo_Click"></Button>-->
|
||||
<WebBrowser x:Name="WebBrowserResourcesAndTools" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="9" Grid.RowSpan="13" Source="https://github.com/proxysu/windows/wiki/ResourcesAndTools" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<!--<TabItem Header="关于" Width="110" Height="30">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>-->
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Window>
|
2321
ProxySU/MainWindow.xaml.cs
Normal file
2321
ProxySU/MainWindow.xaml.cs
Normal file
File diff suppressed because it is too large
Load diff
37
ProxySU/NaiveProxyResultInfoWindow.xaml
Normal file
37
ProxySU/NaiveProxyResultInfoWindow.xaml
Normal file
|
@ -0,0 +1,37 @@
|
|||
<Window x:Class="ProxySU.NaiveProxyResultInfoWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
mc:Ignorable="d"
|
||||
Title="NaiveProxyResultInfoWindow" Height="200" Width="400">
|
||||
<Grid>
|
||||
<GroupBox Header="服务器连接参数">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="0.4*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="服务器地址:" Grid.Column="0" Grid.Row="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxNaiveServerHost" Grid.Column="1" Grid.Row="1" Margin="4"></TextBox>
|
||||
<TextBlock Grid.Column="2" Grid.Row="1"></TextBlock>
|
||||
<TextBlock Text="用户名:" Grid.Column="0" Grid.Row="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxNaiveUser" Grid.Column="1" Grid.Row="2" Margin="4"></TextBox>
|
||||
<TextBlock Grid.Column="2" Grid.Row="2"></TextBlock>
|
||||
<TextBlock Text="密码:" Grid.Column="0" Grid.Row="3"></TextBlock>
|
||||
<TextBox x:Name="TextBoxNaivePassword" Grid.Column="1" Grid.Row="3" Margin="4"></TextBox>
|
||||
<TextBlock Grid.Column="2" Grid.Row="3"></TextBlock>
|
||||
<Button x:Name="ButtonOpenDir" Content="确定" Grid.Column="1" Grid.Row="4" Margin="40,3,40,3" Click="ButtonOpenDir_Click"></Button>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</Window>
|
117
ProxySU/NaiveProxyResultInfoWindow.xaml.cs
Normal file
117
ProxySU/NaiveProxyResultInfoWindow.xaml.cs
Normal file
|
@ -0,0 +1,117 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
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.Shapes;
|
||||
using System.IO;
|
||||
using Renci.SshNet;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Drawing;
|
||||
using QRCoder;
|
||||
namespace ProxySU
|
||||
{
|
||||
/// <summary>
|
||||
/// NaiveProxyResultInfoWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NaiveProxyResultInfoWindow : Window
|
||||
{
|
||||
private string saveFileFolder = "";
|
||||
public NaiveProxyResultInfoWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
TextBoxNaiveServerHost.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||
TextBoxNaiveUser.Text = MainWindow.ReceiveConfigurationParameters[3];
|
||||
TextBoxNaivePassword.Text= MainWindow.ReceiveConfigurationParameters[2];
|
||||
GenerateV2rayShareQRcodeAndBase64Url();
|
||||
}
|
||||
|
||||
private void GenerateV2rayShareQRcodeAndBase64Url()
|
||||
{
|
||||
|
||||
string saveFileFolderFirst = TextBoxNaiveServerHost.Text;
|
||||
int num = 1;
|
||||
saveFileFolder = saveFileFolderFirst;
|
||||
CheckDir("naive_config");
|
||||
while (Directory.Exists(@"naive_config\" + saveFileFolder))
|
||||
{
|
||||
saveFileFolder = saveFileFolderFirst + "_copy_" + num.ToString();
|
||||
num++;
|
||||
}
|
||||
CheckDir(@"naive_config\" + saveFileFolder);
|
||||
//string trojanUrl = $"trojan://{TextBoxTrojanServerPassword.Text}@{TextBoxTrojanServerHost.Text}:{TextBoxTrojanServerPort.Text}#{TextBoxTrojanServerHost.Text}";
|
||||
//MessageBox.Show(v2rayNjsonObject.ToString());
|
||||
//string trojanUrl = "trojan://" + ToBase64Encode(v2rayNjsonObject.ToString());
|
||||
//TextBoxTrojanUrl.Text = trojanUrl;
|
||||
//using (StreamWriter sw = new StreamWriter($"trojan_config\\{saveFileFolder}\\url.txt"))
|
||||
//{
|
||||
// sw.WriteLine(trojanUrl);
|
||||
|
||||
//}
|
||||
//CreateQRCode(trojanUrl);
|
||||
|
||||
//移动NaiveProxy官方程序配置文件到相应目录
|
||||
if (File.Exists(@"naive_config\config.json"))
|
||||
{
|
||||
File.Move(@"naive_config\config.json", @"naive_config\" + saveFileFolder + @"\config.json");
|
||||
//File.Delete(@"config\config.json");//删除该文件
|
||||
}
|
||||
|
||||
using (StreamWriter sw = new StreamWriter($"naive_config\\{saveFileFolder}\\说明.txt"))
|
||||
{
|
||||
sw.WriteLine("config.json");
|
||||
sw.WriteLine("此文件为NaiveProxy官方程序所使用的客户端配置文件,配置为全局模式,socks5地址:127.0.0.1:1080");
|
||||
sw.WriteLine("NaiveProxy官方网站:https://github.com/klzgrad/naiveproxy");
|
||||
sw.WriteLine("NaiveProxy官方程序下载地址:https://github.com/klzgrad/naiveproxy/releases");
|
||||
sw.WriteLine("下载相应版本,Windows选择naiveproxy-x.xx-win.zip,解压后提取naive.exe。与config.json放在同一目录,运行naive.exe即可。");
|
||||
sw.WriteLine("-----------------------------------------\n");
|
||||
sw.WriteLine("其他平台的客户端,暂未发布");
|
||||
//sw.WriteLine("QR.bmp");
|
||||
//sw.WriteLine("此文件为Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)扫码导入节点");
|
||||
//sw.WriteLine("Trojan-QT5 (windows)下载网址:https://github.com/TheWanderingCoel/Trojan-Qt5/releases");
|
||||
//sw.WriteLine("igniter(Android)下载网址:https://github.com/trojan-gfw/igniter/releases");
|
||||
//sw.WriteLine("Shadowrocket(ios)下载,需要使用国外区的AppleID。请自行谷歌方法。");
|
||||
|
||||
//sw.WriteLine("-----------------------------------------\n");
|
||||
//sw.WriteLine("url.txt");
|
||||
//sw.WriteLine("此文件为Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)复制粘贴导入节点的网址");
|
||||
//sw.WriteLine("-----------------------------------------\n");
|
||||
sw.WriteLine("服务器通用连接配置参数");
|
||||
sw.WriteLine($"地址(address):{TextBoxNaiveServerHost.Text}");
|
||||
sw.WriteLine($"用户名:{TextBoxNaiveUser.Text}");
|
||||
sw.WriteLine($"密钥:{TextBoxNaivePassword.Text}");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//判断目录是否存在,不存在则创建
|
||||
private static bool CheckDir(string folder)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(folder))//如果不存在就创建file文件夹
|
||||
Directory.CreateDirectory(folder);//创建该文件夹
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private void ButtonOpenDir_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string openFolderPath = @"naive_config\" + saveFileFolder;
|
||||
System.Diagnostics.Process.Start("explorer.exe", openFolderPath);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
36
ProxySU/ProofreadTimeWindow.xaml
Normal file
36
ProxySU/ProofreadTimeWindow.xaml
Normal file
|
@ -0,0 +1,36 @@
|
|||
<Window x:Class="ProxySU.ProofreadTimeWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
mc:Ignorable="d"
|
||||
Title="ProofreadTimeWindow" Height="450" Width="600">
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton x:Name="RadioButtonNetworkTime" IsChecked="True" Content="同步网络时间" Grid.Column="0" Grid.Row="0" Margin="40"></RadioButton>
|
||||
<TextBlock Text="将远程主机时间校正为网络时间,注意:本机电脑的时间必须也是与网络时间同步的,否则本机电脑V2ray有可能连接出错

推荐:优先使用此方法校对时间" TextWrapping="Wrap" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Margin="20"></TextBlock>
|
||||
|
||||
<RadioButton x:Name="RadioButtonLocalTime" Content="同步本机时间" Grid.Column="1" Grid.Row="0" Margin="40"></RadioButton>
|
||||
<TextBlock Text="将远程主机时间同步为本地时间,注意:本机电脑的时间必须是准确的,与网络时间同步的,否则其他客户端中,有可能连接出错

使用网络校时无法校对时间时,使用此种方法" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Margin="20"></TextBlock>
|
||||
|
||||
<RadioButton x:Name="RadioButtonUpDateLocalTime" Content="更新本机时间" Grid.Column="2" Grid.Row="0" Margin="40"></RadioButton>
|
||||
<TextBlock Text="将本机电脑时间与网络时间同步。

注意:使用此项功能,必须以管理员身份运行本程序" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" Margin="20"></TextBlock>
|
||||
|
||||
<Button x:Name="ButtonTestTime" Content="检测时间误差" Grid.Column="0" Grid.Row="3" Margin="30" Click="ButtonTestTime_Click"/>
|
||||
<Button x:Name="ButtonProofreading" Content="校对时间" Grid.Column="2" Grid.Row="3" Margin="30" Click="ButtonProofreading_Click"></Button>
|
||||
<!--<Button x:Name="ButtonTEST" Content="测试命令" Grid.Column="1" Grid.Row="3" Margin="30" Click="ButtonTEST_Click"></Button>-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
252
ProxySU/ProofreadTimeWindow.xaml.cs
Normal file
252
ProxySU/ProofreadTimeWindow.xaml.cs
Normal file
|
@ -0,0 +1,252 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
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.Shapes;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using Renci.SshNet;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Drawing;
|
||||
using QRCoder;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime;
|
||||
using System.Globalization;
|
||||
|
||||
namespace ProxySU
|
||||
{
|
||||
/// <summary>
|
||||
/// ProofreadTimeWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ProofreadTimeWindow : Window
|
||||
{
|
||||
public static ConnectionInfo ProfreadTimeReceiveConnectionInfo { get; set; }
|
||||
//ProfreadTimeReceiveParameters
|
||||
|
||||
public ProofreadTimeWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
private void ButtonTestTime_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
using (var client = new SshClient(ProfreadTimeReceiveConnectionInfo))
|
||||
{
|
||||
client.Connect();
|
||||
client.RunCommand("rm -f /etc/localtime");
|
||||
client.RunCommand("ln -s /usr/share/zoneinfo/UTC /etc/localtime");
|
||||
//获取远程主机的时间戳
|
||||
long timeStampVPS = Convert.ToInt64(client.RunCommand("date +%s").Result.ToString());
|
||||
//MessageBox.Show(timesStampVPS.ToString());
|
||||
//获取本地时间戳
|
||||
TimeSpan ts = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
long timeStampLocal = Convert.ToInt64(ts.TotalSeconds);
|
||||
client.Disconnect();
|
||||
if (Math.Abs(timeStampLocal - timeStampVPS) >= 90)
|
||||
{
|
||||
|
||||
MessageBox.Show("本地时间与远程主机时间相差超过限制(90秒),V2ray无法建立连接");
|
||||
//currentStatus = "时间较对失败......";
|
||||
//textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
|
||||
//Thread.Sleep(1000);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("误差为:" + Math.Abs(timeStampLocal - timeStampVPS).ToString()+" 可以连接");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonProofreading_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (RadioButtonUpDateLocalTime.IsChecked == true)
|
||||
{
|
||||
//将本机电脑与网络时间同步
|
||||
DateTime netUTCtime = NetTime.GetUTCTime();
|
||||
if (!DateTime.Equals(netUTCtime, new DateTime(1970, 1, 1, 0, 0, 0, 0)))
|
||||
{
|
||||
DateTime localTime = netUTCtime.ToLocalTime();
|
||||
bool setD = UpdateTime.SetDate(localTime);
|
||||
if (setD == true)
|
||||
{
|
||||
MessageBox.Show("本机时间已经更新为网络时间(国家授时中心获取)");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("更新失败,请重试。");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
using (var client = new SshClient(ProfreadTimeReceiveConnectionInfo))
|
||||
{
|
||||
client.Connect();
|
||||
//设置vps为UTC时区
|
||||
client.RunCommand("rm -f /etc/localtime");
|
||||
client.RunCommand("ln -s /usr/share/zoneinfo/UTC /etc/localtime");
|
||||
|
||||
if (RadioButtonLocalTime.IsChecked == true)
|
||||
{
|
||||
//以本地时间为准,校正远程主机时间
|
||||
//获取本地时间戳
|
||||
TimeSpan ts = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
long timeStampLocal = Convert.ToInt64(ts.TotalSeconds);
|
||||
//string stampTime = timeStampLocal.ToString();
|
||||
string sshCmd = $"date --set=\"$(date \"+%Y-%m-%d %H:%M:%S\" -d @{timeStampLocal.ToString()})\"";
|
||||
//MessageBox.Show(sshCmd);
|
||||
//string sshCmd = $"date --set=\"$(date \"+%Y-%m-%d %H:%M:%S\" -d @1489739011)\"";
|
||||
//MessageBox.Show(sshCmd);
|
||||
client.RunCommand(sshCmd);
|
||||
MessageBox.Show("同步本地时间校时完毕");
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//以网络时间为准,校正远程主机时间
|
||||
TimeSpan utcTS = NetTime.GetUTCTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
long timeStampVPS = Convert.ToInt64(utcTS.TotalSeconds);
|
||||
if (timeStampVPS!=0)
|
||||
{
|
||||
//MessageBox.Show(timeStampVPS.ToString());
|
||||
string sshCmd = $"date --set=\"$(date \"+%Y-%m-%d %H:%M:%S\" -d @{timeStampVPS.ToString()})\"";
|
||||
//MessageBox.Show(sshCmd);
|
||||
client.RunCommand(sshCmd);
|
||||
MessageBox.Show("同步网络时间校时完毕");
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// MessageBox.Show(timeStampVPS.ToString());
|
||||
// MessageBox.Show("同步网络时间失败");
|
||||
//}
|
||||
|
||||
}
|
||||
client.Disconnect();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//private void ButtonTEST_Click(object sender, RoutedEventArgs e)
|
||||
//{
|
||||
// //NetTime netTime = new NetTime();
|
||||
// string netDatetime = NetTime.GetUTCTime().ToString();
|
||||
// MessageBox.Show(netDatetime);
|
||||
// //NetTime netTime = new NetTime();
|
||||
// //UpdateTime updateTime = new UpdateTime();
|
||||
// //DateTime netDateTime = netTime.GetBeijingTime();
|
||||
// //MessageBox.Show(netDateTime.ToString());
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 网络时间 代码从网上复制,原网址:https://www.codeleading.com/article/23791981303/
|
||||
/// </summary>
|
||||
public class NetTime
|
||||
{
|
||||
/// <summary>
|
||||
/// 从国家授时中心获取标准GMT时间,读取https://www.tsa.cn
|
||||
/// GMT时间与UTC时间没有差别,可以UTC=GMT
|
||||
/// </summary>
|
||||
/// <returns>返回网络时间</returns>
|
||||
public static DateTime GetUTCTime()
|
||||
{
|
||||
DateTime time;
|
||||
////Thread.Sleep(5000);
|
||||
try
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.tsa.cn");
|
||||
request.Method = "HEAD";
|
||||
request.AllowAutoRedirect = false;
|
||||
HttpWebResponse reponse = (HttpWebResponse)request.GetResponse();
|
||||
string cc = reponse.GetResponseHeader("date");
|
||||
reponse.Close();
|
||||
|
||||
bool s = GMTStrParse(cc, out time);
|
||||
return time;
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
if (ex1.ToString().Contains("403"))
|
||||
{
|
||||
MessageBox.Show("校时操作太频繁,请稍等片刻再操作!");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(ex1.Message);
|
||||
}
|
||||
return time = new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
//return time.AddHours(8); //GMT要加8个小时才是北京时间
|
||||
}
|
||||
public static bool GMTStrParse(string gmtStr, out DateTime gmtTime) //抓取的date是GMT格式的字符串,这里转成datetime
|
||||
{
|
||||
CultureInfo enUS = new CultureInfo("en-US");
|
||||
bool s = DateTime.TryParseExact(gmtStr, "r", enUS, DateTimeStyles.None, out gmtTime);
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新系统时间,代码从网上复制,原网址:https://www.open-open.com/code/view/1430552965599
|
||||
/// </summary>
|
||||
public class UpdateTime
|
||||
{
|
||||
//设置系统时间的API函数
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern bool SetLocalTime(ref SYSTEMTIME time);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct SYSTEMTIME
|
||||
{
|
||||
public short year;
|
||||
public short month;
|
||||
public short dayOfWeek;
|
||||
public short day;
|
||||
public short hour;
|
||||
public short minute;
|
||||
public short second;
|
||||
public short milliseconds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置系统时间
|
||||
/// </summary>
|
||||
/// <param name="dt">需要设置的时间</param>
|
||||
/// <returns>返回系统时间设置状态,true为成功,false为失败</returns>
|
||||
public static bool SetDate(DateTime dt)
|
||||
{
|
||||
SYSTEMTIME st;
|
||||
|
||||
st.year = (short)dt.Year;
|
||||
st.month = (short)dt.Month;
|
||||
st.dayOfWeek = (short)dt.DayOfWeek;
|
||||
st.day = (short)dt.Day;
|
||||
st.hour = (short)dt.Hour;
|
||||
st.minute = (short)dt.Minute;
|
||||
st.second = (short)dt.Second;
|
||||
st.milliseconds = (short)dt.Millisecond;
|
||||
bool rt = SetLocalTime(ref st);
|
||||
return rt;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,16 +1,18 @@
|
|||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("ProxySuper.WPF")]
|
||||
[assembly: AssemblyTitle("ProxySU")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ProxySuper.WPF")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyProduct("ProxySU")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
@ -46,8 +48,8 @@ using System.Windows;
|
|||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("4.1.10.0")]
|
||||
[assembly: AssemblyFileVersion("4.1.10.0")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -1,61 +1,69 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProxySuper.WPF.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
namespace ProxySU.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||
/// 强类型资源类,用于查找本地化字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProxySuper.WPF.Properties.Resources", typeof(Resources).Assembly);
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProxySU.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// 覆盖当前线程的 CurrentUICulture 属性
|
||||
/// 使用此强类型的资源类的资源查找。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
|
@ -1,24 +1,28 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProxySuper.WPF.Properties {
|
||||
|
||||
|
||||
namespace ProxySU.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
179
ProxySU/ProxySU.csproj
Normal file
179
ProxySU/ProxySU.csproj
Normal file
|
@ -0,0 +1,179 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DD5505BC-E7F1-4D03-ABC7-B636E893FC09}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>ProxySU</RootNamespace>
|
||||
<AssemblyName>ProxySU</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Deterministic>true</Deterministic>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>ProxySU.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\json.net\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QRCoder">
|
||||
<HintPath>..\qrcoder\net40\QRCoder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Renci.SshNet">
|
||||
<HintPath>..\ssh.net\net40\Renci.SshNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="NaiveProxyResultInfoWindow.xaml.cs">
|
||||
<DependentUpon>NaiveProxyResultInfoWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProofreadTimeWindow.xaml.cs">
|
||||
<DependentUpon>ProofreadTimeWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ResultClientInformation.xaml.cs">
|
||||
<DependentUpon>ResultClientInformation.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TemplateConfiguration.xaml.cs">
|
||||
<DependentUpon>TemplateConfiguration.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TrojanResultClientInfoWindow.xaml.cs">
|
||||
<DependentUpon>TrojanResultClientInfoWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TrojanTemplateWindow.xaml.cs">
|
||||
<DependentUpon>TrojanTemplateWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="NaiveProxyResultInfoWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ProofreadTimeWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ResultClientInformation.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="TemplateConfiguration.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="TrojanResultClientInfoWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="TrojanTemplateWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="ProxySU.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>del "$(TargetDir)*.xml"
|
||||
del "$(TargetDir)*.pdb"
|
||||
del "$(TargetDir)*.zip"
|
||||
"D:\Program Files\7-Zip\7z.exe" a $(TargetDir)Release.zip $(TargetDir) -xr!*config</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
13
ProxySU/ProxySU.csproj.user
Normal file
13
ProxySU/ProxySU.csproj.user
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishUrlHistory />
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<BootstrapperUrlHistory />
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>zh-CN</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
90
ProxySU/ResultClientInformation.xaml
Normal file
90
ProxySU/ResultClientInformation.xaml
Normal file
|
@ -0,0 +1,90 @@
|
|||
<Window x:Class="ProxySU.ResultClientInformation"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
mc:Ignorable="d"
|
||||
Title="ResultClientInformation" Height="650" Width="600">
|
||||
<Grid>
|
||||
<GroupBox Header="服务器连接配置">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="地址(address)" Grid.Column="0" Grid.Row="0" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxHostAddress" IsReadOnly="True" Grid.Column="1" Grid.Row="0" Margin="2"></TextBox>
|
||||
<TextBlock Text="说明" Grid.Column="2" Grid.Row="0"></TextBlock>
|
||||
<TextBlock Text="端口(port)" Grid.Column="0" Grid.Row="1" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxPort" IsReadOnly="True" Grid.Column="1" Grid.Row="1" Margin="2"></TextBox>
|
||||
<TextBlock Text="说明" Grid.Column="2" Grid.Row="1"></TextBlock>
|
||||
<TextBlock Text="用户ID(uuid)" Grid.Column="0" Grid.Row="2" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxUUID" IsReadOnly="True" Grid.Column="1" Grid.Row="2" Margin="2"></TextBox>
|
||||
<TextBlock Text="说明" Grid.Column="2" Grid.Row="2"></TextBlock>
|
||||
<TextBlock Text="额外ID" Grid.Column="0" Grid.Row="3" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxUUIDextra" IsReadOnly="False" Grid.Column="1" Grid.Row="3" Margin="2"></TextBox>
|
||||
<TextBlock Text="默认16,可以填不超过64的值,客户端没有此选项可不填" TextWrapping="Wrap" Grid.Column="2" Grid.Row="3"></TextBlock>
|
||||
<TextBlock Text="加密方式" Grid.Column="0" Grid.Row="4" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxEncryption" IsReadOnly="True" Grid.Column="1" Grid.Row="4" Margin="2"></TextBox>
|
||||
<TextBlock Text="默认auto" Grid.Column="2" Grid.Row="4"></TextBlock>
|
||||
<TextBlock Text="传输协议" Grid.Column="0" Grid.Row="5" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxTransmission" IsReadOnly="True" Grid.Column="1" Grid.Row="5" Margin="2"></TextBox>
|
||||
<TextBlock Text="说明" Grid.Column="2" Grid.Row="5"></TextBlock>
|
||||
<TextBlock Text="伪装类型" Grid.Column="0" Grid.Row="6" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxCamouflageType" IsReadOnly="True" Grid.Column="1" Grid.Row="6" Margin="2"></TextBox>
|
||||
<TextBlock Text="说明" Grid.Column="2" Grid.Row="6"></TextBlock>
|
||||
<TextBlock x:Name="TextBlocTLSonOrNo" Text="是否使用TLS" Grid.Column="0" Grid.Row="7" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxTLS" IsReadOnly="True" Grid.Column="1" Grid.Row="7" Margin="2"></TextBox>
|
||||
<TextBlock x:Name="TextBlocTLSonOrNoExplain" Text="说明" Grid.Column="2" Grid.Row="7"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockHost" Text="Host" Grid.Column="0" Grid.Row="8" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxHost" IsReadOnly="True" Grid.Column="1" Grid.Row="8" Margin="2"></TextBox>
|
||||
<TextBlock x:Name="TextBlockHostExplain" Text="说明" Grid.Column="2" Grid.Row="8"></TextBlock>
|
||||
|
||||
<TextBlock x:Name="TextBlockPath" Text="路径(Path)" Grid.Column="0" Grid.Row="9" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxPath" IsReadOnly="True" Grid.Column="1" Grid.Row="9" Margin="2"></TextBox>
|
||||
<TextBlock x:Name="TextBlockPathExplain" Text="说明" Grid.Column="2" Grid.Row="9"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockQuicKey" Text="QUIC密钥" Grid.Column="0" Grid.Row="10" Margin="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxQuicKey" IsReadOnly="True" Grid.Column="1" Grid.Row="10" Margin="2"></TextBox>
|
||||
<TextBlock x:Name="TextBlockQuicKeyExplain" Text="说明" Grid.Column="2" Grid.Row="10"></TextBlock>
|
||||
|
||||
<TextBlock Text="以上参数可以手动输入客户端,用于V2ray官方客户端的配置文件已经存放入config目录下,点击确定可打开" Grid.Column="0" Grid.Row="11" Grid.ColumnSpan="2" TextWrapping="Wrap"></TextBlock>
|
||||
<Button x:Name="ButtonOpenSaveDir" Content="确定" Grid.Column="2" Grid.Row="11" Grid.RowSpan="1" Margin="5" Click="ButtonOpenSaveDir_Click"></Button>
|
||||
<Grid Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="2" Grid.RowSpan="7">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="85"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="二维码和vmess链接可用于

v2rayN(windows)

Shadowrocket(ios)

v2rayNG(Android)

导入v2ray节点" TextWrapping="Wrap" Grid.Column="0"></TextBlock>
|
||||
<Image x:Name="ImageShareQRcode" Grid.Column="1"></Image>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<TextBox x:Name="TextBoxvVmessUrl" TextWrapping="Wrap" Grid.Column="2" Grid.Row="12" Grid.RowSpan="7"></TextBox>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</Window>
|
439
ProxySU/ResultClientInformation.xaml.cs
Normal file
439
ProxySU/ResultClientInformation.xaml.cs
Normal file
|
@ -0,0 +1,439 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
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.Shapes;
|
||||
using System.IO;
|
||||
using Renci.SshNet;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Drawing;
|
||||
using QRCoder;
|
||||
|
||||
|
||||
namespace ProxySU
|
||||
{
|
||||
/// <summary>
|
||||
/// ResultClientInformation.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ResultClientInformation : Window
|
||||
{
|
||||
private string saveFileFolder = "";
|
||||
public ResultClientInformation()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
//主机端口
|
||||
TextBoxPort.Text = MainWindow.ReceiveConfigurationParameters[1];
|
||||
//用户ID(uuid)
|
||||
TextBoxUUID.Text = MainWindow.ReceiveConfigurationParameters[2];
|
||||
//额外ID
|
||||
TextBoxUUIDextra.Text = "16";
|
||||
//路径Path
|
||||
TextBoxPath.Text = MainWindow.ReceiveConfigurationParameters[3];
|
||||
//主机地址
|
||||
TextBoxHostAddress.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||
//TLS的Host
|
||||
TextBoxHost.Text = "";
|
||||
//加密方式,一般都为auto
|
||||
TextBoxEncryption.Text = "auto";
|
||||
//伪装类型
|
||||
TextBoxCamouflageType.Text = MainWindow.ReceiveConfigurationParameters[5];
|
||||
//QUIC密钥
|
||||
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
|
||||
|
||||
if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLS2Web"))
|
||||
{
|
||||
TextBoxTransmission.Text = "ws";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "tls";
|
||||
ShowPath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TCP"))
|
||||
{
|
||||
TextBoxTransmission.Text = "tcp";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "TCPhttp"))
|
||||
{
|
||||
TextBoxTransmission.Text = "tcp";
|
||||
TextBoxCamouflageType.Text = "http";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "tcpTLS"))
|
||||
{
|
||||
TextBoxTransmission.Text = "tcp";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "tls";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "tcpTLSselfSigned"))
|
||||
{
|
||||
TextBoxTransmission.Text = "tcp";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "tls";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "webSocket"))
|
||||
{
|
||||
TextBoxTransmission.Text = "ws";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLS"))
|
||||
{
|
||||
TextBoxTransmission.Text = "ws";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "tls";
|
||||
ShowPath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "WebSocketTLSselfSigned"))
|
||||
{
|
||||
TextBoxTransmission.Text = "ws";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "tls";
|
||||
ShowPath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "Http2"))
|
||||
{
|
||||
TextBoxTransmission.Text = "h2";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "tls";
|
||||
ShowPath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "http2Web"))
|
||||
{
|
||||
TextBoxTransmission.Text = "h2";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxHost.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||
TextBoxTLS.Text = "tls";
|
||||
ShowPath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "http2selfSigned"))
|
||||
{
|
||||
TextBoxTransmission.Text = "h2";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "tls";
|
||||
ShowPath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPNone"))
|
||||
{
|
||||
TextBoxTransmission.Text = "kcp";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2SRTP"))
|
||||
{
|
||||
TextBoxTransmission.Text = "kcp";
|
||||
TextBoxCamouflageType.Text = "srtp";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPuTP"))
|
||||
{
|
||||
TextBoxTransmission.Text = "kcp";
|
||||
TextBoxCamouflageType.Text = "utp";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WechatVideo"))
|
||||
{
|
||||
TextBoxTransmission.Text = "kcp";
|
||||
TextBoxCamouflageType.Text = "wechat-video";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2DTLS"))
|
||||
{
|
||||
TextBoxTransmission.Text = "kcp";
|
||||
TextBoxCamouflageType.Text = "dtls";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WireGuard"))
|
||||
{
|
||||
TextBoxTransmission.Text = "kcp";
|
||||
TextBoxCamouflageType.Text = "wireguard";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicNone"))
|
||||
{
|
||||
TextBoxTransmission.Text = "quic";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
ShowQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicSRTP"))
|
||||
{
|
||||
TextBoxTransmission.Text = "quic";
|
||||
TextBoxCamouflageType.Text = "srtp";
|
||||
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
ShowQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "Quic2uTP"))
|
||||
{
|
||||
TextBoxTransmission.Text = "quic";
|
||||
TextBoxCamouflageType.Text = "utp";
|
||||
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
ShowQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicWechatVideo"))
|
||||
{
|
||||
TextBoxTransmission.Text = "quic";
|
||||
TextBoxCamouflageType.Text = "wechat-video";
|
||||
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
ShowQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicDTLS"))
|
||||
{
|
||||
TextBoxTransmission.Text = "quic";
|
||||
TextBoxCamouflageType.Text = "dtls";
|
||||
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
ShowQuicKey();
|
||||
}
|
||||
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicWireGuard"))
|
||||
{
|
||||
TextBoxTransmission.Text = "quic";
|
||||
TextBoxCamouflageType.Text = "wireguard";
|
||||
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
ShowQuicKey();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
TextBoxTransmission.Text = "tcp";
|
||||
TextBoxCamouflageType.Text = "none";
|
||||
TextBoxTLS.Text = "none";
|
||||
HidePath();
|
||||
HideQuicKey();
|
||||
}
|
||||
CheckDir("v2ray_config");
|
||||
|
||||
GenerateV2rayShareQRcodeAndBase64Url();
|
||||
|
||||
}
|
||||
private void HidePath()
|
||||
{
|
||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||
TextBlockPathExplain.Visibility = Visibility.Collapsed;
|
||||
|
||||
}
|
||||
private void ShowPath()
|
||||
{
|
||||
TextBlockPath.Visibility = Visibility.Visible;
|
||||
TextBoxPath.Visibility = Visibility.Visible;
|
||||
TextBlockPathExplain.Visibility = Visibility.Visible;
|
||||
|
||||
}
|
||||
private void HideQuicKey()
|
||||
{
|
||||
TextBlockQuicKey.Visibility = Visibility.Collapsed;
|
||||
TextBoxQuicKey.Visibility = Visibility.Collapsed;
|
||||
TextBlockQuicKeyExplain.Visibility = Visibility.Collapsed;
|
||||
|
||||
}
|
||||
private void ShowQuicKey()
|
||||
{
|
||||
TextBlockQuicKey.Visibility = Visibility.Visible;
|
||||
TextBoxQuicKey.Visibility = Visibility.Visible;
|
||||
TextBlockQuicKeyExplain.Visibility = Visibility.Visible;
|
||||
|
||||
}
|
||||
//生成v2rayN客户端导入文件
|
||||
private void GenerateV2rayShareQRcodeAndBase64Url()
|
||||
{
|
||||
//生成v2rayN的json文件
|
||||
string v2rayNjsonFile = @"
|
||||
{
|
||||
""v"": """",
|
||||
""ps"": """",
|
||||
""add"": """",
|
||||
""port"": """",
|
||||
""id"": """",
|
||||
""aid"": """",
|
||||
""net"": """",
|
||||
""type"": """",
|
||||
""host"": """",
|
||||
""path"": """",
|
||||
""tls"": """"
|
||||
}";
|
||||
//MessageBox.Show(v2rayNjsonFile);
|
||||
JObject v2rayNjsonObject = JObject.Parse(v2rayNjsonFile);
|
||||
v2rayNjsonObject["v"] = "2";
|
||||
v2rayNjsonObject["add"] = TextBoxHostAddress.Text; //设置域名
|
||||
v2rayNjsonObject["port"] = TextBoxPort.Text; //设置端口
|
||||
v2rayNjsonObject["id"] = TextBoxUUID.Text; //设置uuid
|
||||
v2rayNjsonObject["aid"] = TextBoxUUIDextra.Text; //设置额外ID
|
||||
v2rayNjsonObject["net"] = TextBoxTransmission.Text; //设置传输模式
|
||||
v2rayNjsonObject["type"] = TextBoxCamouflageType.Text; //设置伪装类型
|
||||
|
||||
if (TextBoxTransmission.Text.Contains("quic")==true)
|
||||
{
|
||||
v2rayNjsonObject["path"] = TextBoxQuicKey.Text;//设置quic密钥
|
||||
v2rayNjsonObject["host"] = "chacha20-poly1305";
|
||||
}
|
||||
else
|
||||
{
|
||||
v2rayNjsonObject["path"] = TextBoxPath.Text; //设置路径
|
||||
v2rayNjsonObject["host"] = TextBoxHost.Text;//设置TLS的Host
|
||||
}
|
||||
|
||||
v2rayNjsonObject["tls"] = TextBoxTLS.Text; //设置是否启用TLS
|
||||
v2rayNjsonObject["ps"] = v2rayNjsonObject["add"]; //设置备注
|
||||
//MessageBox.Show(v2rayNjsonObject["v"].ToString());
|
||||
|
||||
string saveFileFolderFirst = v2rayNjsonObject["ps"].ToString();
|
||||
int num = 1;
|
||||
saveFileFolder = saveFileFolderFirst;
|
||||
CheckDir(@"v2ray_config");
|
||||
while (Directory.Exists(@"v2ray_config\" + saveFileFolder))
|
||||
{
|
||||
saveFileFolder = saveFileFolderFirst + "_copy_" + num.ToString();
|
||||
num++;
|
||||
}
|
||||
CheckDir(@"v2ray_config\" + saveFileFolder);
|
||||
//MessageBox.Show(v2rayNjsonObject.ToString());
|
||||
string vmessUrl = "vmess://" + ToBase64Encode(v2rayNjsonObject.ToString());
|
||||
TextBoxvVmessUrl.Text = vmessUrl;
|
||||
using (StreamWriter sw = new StreamWriter($"v2ray_config\\{saveFileFolder}\\url.txt"))
|
||||
{
|
||||
sw.WriteLine(vmessUrl);
|
||||
|
||||
}
|
||||
CreateQRCode(vmessUrl);
|
||||
|
||||
if (File.Exists(@"v2ray_config\config.json"))
|
||||
{
|
||||
File.Move(@"v2ray_config\config.json", @"v2ray_config\" + saveFileFolder + @"\config.json");
|
||||
//File.Delete(@"config\config.json");//删除该文件
|
||||
}
|
||||
|
||||
using (StreamWriter sw = new StreamWriter($"v2ray_config\\{saveFileFolder}\\说明.txt"))
|
||||
{
|
||||
sw.WriteLine("config.json");
|
||||
sw.WriteLine("此文件为v2ray官方程序所使用的客户端配置文件,配置为全局模式,socks5地址:127.0.0.1:1080,http代理地址:127.0.0.1:1081");
|
||||
sw.WriteLine("v2ray官方网站:https://www.v2ray.com/");
|
||||
sw.WriteLine("v2ray官方程序下载地址:https://github.com/v2ray/v2ray-core/releases");
|
||||
sw.WriteLine("下载相应版本,Windows选择v2ray-windows-64.zip或者v2ray-windows-32.zip,解压后提取v2ctl.exe和v2ray.exe。与config.json放在同一目录,运行v2ray.exe即可。");
|
||||
sw.WriteLine("-----------------------------------------");
|
||||
sw.WriteLine("QR.bmp");
|
||||
sw.WriteLine("此文件为v2rayN、v2rayNG(Android)、Shadowrocket(ios)扫码导入节点");
|
||||
sw.WriteLine("v2rayN下载网址:https://github.com/2dust/v2rayN/releases");
|
||||
sw.WriteLine("v2rayNG(Android)下载网址:https://github.com/2dust/v2rayNG/releases");
|
||||
sw.WriteLine("v2rayNG(Android)在Google Play下载网址:https://play.google.com/store/apps/details?id=com.v2ray.ang");
|
||||
sw.WriteLine("Shadowrocket(ios)下载,需要使用国外区的AppleID。请自行谷歌方法。");
|
||||
|
||||
sw.WriteLine("-----------------------------------------");
|
||||
sw.WriteLine("url.txt");
|
||||
sw.WriteLine("此文件为v2rayN、v2rayNG(Android)、Shadowrocket(ios)复制粘贴导入节点的vmess网址");
|
||||
sw.WriteLine("-----------------------------------------\n");
|
||||
sw.WriteLine("服务器通用连接配置参数");
|
||||
sw.WriteLine($"地址(address):{TextBoxHostAddress.Text}");
|
||||
sw.WriteLine($"端口(Port):{TextBoxPort.Text}");
|
||||
sw.WriteLine($"用户ID(uuid):{TextBoxUUID.Text}");
|
||||
sw.WriteLine($"额外ID:{TextBoxUUIDextra.Text}");
|
||||
sw.WriteLine($"加密方式:{TextBoxEncryption.Text}");
|
||||
sw.WriteLine($"传输协议:{TextBoxTransmission.Text}");
|
||||
sw.WriteLine($"伪装类型:{TextBoxCamouflageType.Text}");
|
||||
sw.WriteLine($"是否使用TLS:{TextBoxTLS.Text}");
|
||||
sw.WriteLine($"host:{TextBoxHostAddress.Text}");
|
||||
sw.WriteLine($"路径(Path):{TextBoxPath.Text}");
|
||||
sw.WriteLine($"QUIC密钥:{TextBoxQuicKey.Text}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
//生成base64
|
||||
private string ToBase64Encode(string text)
|
||||
{
|
||||
if (String.IsNullOrEmpty(text))
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
byte[] textBytes = Encoding.UTF8.GetBytes(text);
|
||||
return Convert.ToBase64String(textBytes);
|
||||
}
|
||||
//生成QRcoder图片
|
||||
private void CreateQRCode(string varBase64)
|
||||
{
|
||||
//string varBase64 = varBase64;
|
||||
QRCodeGenerator qrGenerator = new QRCodeGenerator();
|
||||
QRCodeData qrCodeData = qrGenerator.CreateQrCode(varBase64, QRCodeGenerator.ECCLevel.Q);
|
||||
QRCode qrCode = new QRCode(qrCodeData);
|
||||
Bitmap qrCodeImage = qrCode.GetGraphic(20);
|
||||
IntPtr myImagePtr = qrCodeImage.GetHbitmap();
|
||||
BitmapSource imgsource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(myImagePtr, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
|
||||
ImageShareQRcode.Source = imgsource;
|
||||
//DeleteObject(myImagePtr);
|
||||
qrCodeImage.Save($"v2ray_config\\{saveFileFolder}\\QR.bmp");
|
||||
//ImageShareQRcode.Source = @"config\v2rayN.bmp";
|
||||
}
|
||||
//判断目录是否存在,不存在则创建
|
||||
private static bool CheckDir(string folder)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(folder))//如果不存在就创建file文件夹
|
||||
Directory.CreateDirectory(folder);//创建该文件夹
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonOpenSaveDir_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string openFolderPath = @"v2ray_config\" + saveFileFolder;
|
||||
System.Diagnostics.Process.Start("explorer.exe", openFolderPath);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
277
ProxySU/TemplateConfiguration.xaml
Normal file
277
ProxySU/TemplateConfiguration.xaml
Normal file
|
@ -0,0 +1,277 @@
|
|||
<Window x:Name="TemplateConfiguration" x:Class="ProxySU.WindowTemplateConfiguration"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
mc:Ignorable="d"
|
||||
Title="TemplateConfiguration" Height="600" Width="850">
|
||||
<Window.Resources>
|
||||
<Style BasedOn="{StaticResource {x:Type TextBox}}"
|
||||
TargetType="TextBox"
|
||||
x:Key="TitleText">
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Text" Value=""/>
|
||||
<Condition Property="TextBox.IsFocused" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="Gray" Margin="0">
|
||||
<TextBlock x:Name="MainTextBlock" Text="{TemplateBinding TextBox.Tag}" Width="{TemplateBinding TextBox.ActualWidth}" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</MultiTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Header="模板库" Grid.Row="0" Grid.RowSpan="3">
|
||||
<Grid>
|
||||
<TabControl x:Name="TabControlTemplate">
|
||||
<TabItem Header="热门方案" Width="110" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton x:Name="RadioButtonWebSocketTLS2WebHot" Content="WebSocket+TLS+Web" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
|
||||
<TextBlock Text="稳定性强,使用Caddy做伪装网站,隐藏代理,会被识别为访问网站的https流量,抗封锁识别最强。(需要域名)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="TCP传输协议" Width="110" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton x:Name="RadioButtonTCP" Content="TCP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||
<TextBlock Text="数据加密传输,会被识别为未知的tcp流量" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonTCPhttp" Content="TCP+Http伪装" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCPhttp_Checked" ></RadioButton>
|
||||
<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="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>
|
||||
<TabItem Header="WebSocket传输协议" Width="150" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.2*"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton x:Name="RadioButtonWebSocket" Content="WebSocket" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"/>
|
||||
<TextBlock Text="数据加密传输,传输协议使用WebSocket,未启用TLS,将被识别为WebSocket流量。" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonWebSocketTLS" Content="WebSocket+TLS" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonHTTP2_Checked"/>
|
||||
<TextBlock Text="数据加密传输,传输协议使用WebSocket,启用TLS,将被识别为TLS流量。(需要域名)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonWebSocketTLS2Web" Content="WebSocket+TLS+Web" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonWebSocketTLS2Web_Checked"></RadioButton>
|
||||
<TextBlock Text="稳定性强,使用Caddy做伪装网站,隐藏代理,会被识别为访问网站的https流量,抗封锁识别最强。(需要域名)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonWebSocketTLSselfSigned" Content="WebSocket+TLS(自签证书)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonWebSocketTLSselfSigned_Checked"></RadioButton>
|
||||
<TextBlock Text="数据加密传输,传输协议使用WebSocket,启用TLS,将被识别为TLS流量。(无需域名)" TextWrapping="Wrap" 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>
|
||||
<TabItem Header="Http/2传输协议" Width="110" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="mKCP传输协议" Width="110" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton x:Name="RadioButtonMkcpNone" Content="mKCP(无伪装)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||
<TextBlock Text="数据加密传输,以增加流量消耗来加速,减少延迟,udp协议,无伪装,会被识别为udp流量" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||
<TextBlock Text="同mKCP(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime)" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||
<TextBlock Text="同mKCP(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||
<TextBlock Text="同mKCP(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="5" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||
<TextBlock Text="同mKCP(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="6" Checked="RadioButtonTCP_Checked"></RadioButton>
|
||||
<TextBlock Text="同mKCP(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="QUIC传输协议" Width="110" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="提醒:Shadowrocket目前暂不支持QUIC的传输模式。" Foreground="Red" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="5"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonQuicNone" Content="QUIC(无伪装)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonQuicNone_Checked"></RadioButton>
|
||||
<TextBlock Text="数据加密传输,无伪装会被识别为udp流量,谷歌出品,优点:减少延迟、多路复用、连接迁移" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonQuicSRTP" Content="QUIC+SRTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonQuicNone_Checked"></RadioButton>
|
||||
<TextBlock Text="同QUIC(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime)" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonQuic2uTP" Content="QUIC+uTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonQuicNone_Checked"></RadioButton>
|
||||
<TextBlock Text="同QUIC(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonQuicWechatVideo" Content="QUIC+WechatVideo" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonQuicNone_Checked"></RadioButton>
|
||||
<TextBlock Text="同QUIC(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonQuicDTLS" Content="QUIC+DTLS 1.2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="5" Checked="RadioButtonQuicNone_Checked"></RadioButton>
|
||||
<TextBlock Text="同QUIC(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock>
|
||||
<RadioButton x:Name="RadioButtonQuicWireGuard" Content="QUIC+WireGuard" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="6" Checked="RadioButtonQuicNone_Checked"></RadioButton>
|
||||
<TextBlock Text="同QUIC(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="其他设置" Grid.Row="3" Grid.RowSpan="2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition ></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock x:Name="TextBlockServerListenPort" Text="服务端口:" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxServerListenPort" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonServerListenPort" Content="随机选择" Grid.Column="4" Grid.Row="0" Margin="2" Click="ButtonServerListenPort_Click"></Button>
|
||||
<TextBlock x:Name="TextBlockNewUUID" Text="UUID:" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxNewUUID" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonNewUUID" Content="更新" Grid.Column="4" Grid.Row="1" Margin="2" Click="ButtonNewUUID_Click"></Button>
|
||||
<TextBlock Text="使用已有UUID,直接粘贴到框中" TextWrapping="Wrap" Grid.Column="5" Grid.Row="1" Grid.ColumnSpan="2" Margin="0"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockQuicUUID" Text="QUIC密钥" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxQuicUUID" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonQuicUUID" Content="更新" Grid.Column="4" Grid.Row="2" Margin="2" Click="ButtonQuicUUID_Click"></Button>
|
||||
<TextBlock x:Name="TextBlockPath" Text="路径:" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxPath" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonPath" Content="随机" Grid.Column="4" Grid.Row="3" Margin="2" Click="ButtonPath_Click"></Button>
|
||||
<TextBlock x:Name="TextBlockDomain" Text="域名:" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxDomain" Style="{StaticResource TitleText}" Tag="不可为空" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonDomain" Content="检测" Visibility="Collapsed" Grid.Column="4" Grid.Row="4" Margin="2" Click="ButtonDomain_Click"></Button>
|
||||
<TextBlock x:Name="TextBlockMaskSites" Text="伪装网站:" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxMaskSites" Style="{StaticResource TitleText}" Tag="设置此项可增加代理的隐蔽(可为空)" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3" Margin="3"></TextBox>
|
||||
|
||||
|
||||
<Button x:Name="ButtondDecide" Content="确定" Grid.Column="1" Grid.Row="6" Margin="0" Click="ButtondDecide_Click"></Button>
|
||||
<Button x:Name="ButtondCancel" Content="取消" Grid.Column="3" Grid.Row="6" Margin="0" Click="ButtondCancel_Click"></Button>
|
||||
<!--<Button x:Name="ButtonTestChecked" Content="测试选中状态" Grid.Column="5" Grid.Row="6" Click="ButtonTestChecked_Click"></Button>-->
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
588
ProxySU/TemplateConfiguration.xaml.cs
Normal file
588
ProxySU/TemplateConfiguration.xaml.cs
Normal file
|
@ -0,0 +1,588 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
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.Shapes;
|
||||
//using System.Windows.Forms;
|
||||
|
||||
namespace ProxySU
|
||||
{
|
||||
/// <summary>
|
||||
/// WindowTemplateConfiguration.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class WindowTemplateConfiguration : Window
|
||||
{
|
||||
public WindowTemplateConfiguration()
|
||||
{
|
||||
InitializeComponent();
|
||||
//RadioButtonTCP.IsChecked = true;
|
||||
}
|
||||
//取消不在当前活动选项卡中的其他所有选项卡中的所有RadioBuuton的选中状态
|
||||
//代码参考网址:https://blog.csdn.net/weixin_42583999/article/details/103468857
|
||||
//调用:UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
private void UncheckLayouts(TabItem activePage)
|
||||
{
|
||||
foreach (TabItem tabPage in TabControlTemplate.Items)
|
||||
{
|
||||
if (tabPage == activePage) continue;
|
||||
Grid grid = (Grid)tabPage.Content;
|
||||
foreach (UIElement element in grid.Children)
|
||||
{
|
||||
if (element is RadioButton)
|
||||
{
|
||||
RadioButton radiobutton = (element as RadioButton);
|
||||
radiobutton.IsChecked = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtondDecide_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//UncheckLayouts(TabControlTemplate);
|
||||
//TCP模式被选中
|
||||
if (RadioButtonTCP.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "TCP";
|
||||
|
||||
}
|
||||
//TCP+http伪装模式被选中
|
||||
else if (RadioButtonTCPhttp.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "TCPhttp";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "http";
|
||||
}
|
||||
//TCP+TLS模式被选中
|
||||
else if (RadioButtonTCP2TLS.IsChecked == true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
|
||||
{
|
||||
MessageBox.Show("域名不能为空!");
|
||||
return;
|
||||
}
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "tcpTLS";
|
||||
|
||||
//传递域名
|
||||
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
|
||||
}
|
||||
//tcp+TLS(自签证书)模式被选中
|
||||
else if (RadioButtonTcpTLS2SelfSigned.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "tcpTLSselfSigned";
|
||||
|
||||
//传递域名
|
||||
// MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
|
||||
}
|
||||
//webSocket模式被选中
|
||||
else if (RadioButtonWebSocket.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "webSocket";
|
||||
|
||||
}
|
||||
//WebSocket+TLS模式被选中
|
||||
else if (RadioButtonWebSocketTLS.IsChecked == true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
|
||||
{
|
||||
MessageBox.Show("域名不能为空!");
|
||||
return;
|
||||
}
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLS";
|
||||
//传递路径
|
||||
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
|
||||
//传递域名
|
||||
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
|
||||
}
|
||||
|
||||
//WebSocket+TLS+Web模式被选中
|
||||
else if (RadioButtonWebSocketTLS2Web.IsChecked == true|| RadioButtonWebSocketTLS2WebHot.IsChecked==true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
|
||||
{
|
||||
MessageBox.Show("域名不能为空!");
|
||||
return;
|
||||
}
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLS2Web";
|
||||
//传递路径
|
||||
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
|
||||
//传递域名
|
||||
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
//传递伪装网站
|
||||
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString();
|
||||
//处理伪装网站域名中的前缀
|
||||
if (TextBoxMaskSites.Text.ToString().Length >= 7)
|
||||
{
|
||||
string testDomain = TextBoxMaskSites.Text.Substring(0, 7);
|
||||
if (String.Equals(testDomain, "https:/") || String.Equals(testDomain, "http://"))
|
||||
{
|
||||
//MessageBox.Show(testDomain);
|
||||
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.Replace("/", "\\/");
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow.ReceiveConfigurationParameters[7] = "http:\\/\\/" + TextBoxMaskSites.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
//WebSocket+TLS(自签证书)模式被选中
|
||||
else if (RadioButtonWebSocketTLSselfSigned.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "WebSocketTLSselfSigned";
|
||||
//传递路径
|
||||
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
|
||||
//传递域名
|
||||
//MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
|
||||
}
|
||||
//http2模式被选中
|
||||
else if (RadioButtonHTTP2.IsChecked == true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
|
||||
{
|
||||
MessageBox.Show("域名不能为空!");
|
||||
return;
|
||||
}
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "Http2";
|
||||
//传递路径
|
||||
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
|
||||
//传递域名
|
||||
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
|
||||
}
|
||||
//http2+TLS+Web模式被选中
|
||||
else if (RadioButtonHTTP2Web.IsChecked == true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
|
||||
{
|
||||
MessageBox.Show("域名不能为空!");
|
||||
return;
|
||||
}
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "http2Web";
|
||||
//传递路径
|
||||
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
|
||||
//传递域名
|
||||
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
//传递伪装网站
|
||||
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString();
|
||||
//处理伪装网站域名中的前缀
|
||||
if (TextBoxMaskSites.Text.ToString().Length >= 7)
|
||||
{
|
||||
string testDomain = TextBoxMaskSites.Text.Substring(0, 7);
|
||||
if (String.Equals(testDomain, "https:/") || String.Equals(testDomain, "http://"))
|
||||
{
|
||||
//MessageBox.Show(testDomain);
|
||||
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.Replace("/", "\\/");
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow.ReceiveConfigurationParameters[7] = "http:\\/\\/" + TextBoxMaskSites.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
//http2(自签证书)模式被选中
|
||||
else if (RadioButtonHTTP2selfSigned.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "http2selfSigned";
|
||||
//传递路径
|
||||
MainWindow.ReceiveConfigurationParameters[3] = TextBoxPath.Text.ToString();
|
||||
//传递域名
|
||||
//MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
|
||||
}
|
||||
//mKCP无伪装模式被选中
|
||||
else if (RadioButtonMkcpNone.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "mKCPNone";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "none";
|
||||
}
|
||||
//mKCP+srtp伪装模式被选中
|
||||
else if (RadioButton2mKCP2SRTP.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2SRTP";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "srtp";
|
||||
}
|
||||
//mKCP+utp伪装模式被选中
|
||||
else if (RadioButton2mKCPuTP.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "mKCPuTP";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "utp";
|
||||
}
|
||||
//mKCP+wechat-video伪装模式被选中
|
||||
else if (RadioButton2mKCP2WechatVideo.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WechatVideo";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "wechat-video";
|
||||
}
|
||||
//mKCP+dtls伪装模式被选中
|
||||
else if (RadioButton2mKCP2DTLS.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2DTLS";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "dtls";
|
||||
}
|
||||
//mKCP+wireguard伪装模式被选中
|
||||
else if (RadioButton2mKCP2WireGuard.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WireGuard";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "wireguard";
|
||||
}
|
||||
//QUIC无伪装模式被选中
|
||||
else if (RadioButtonQuicNone.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "QuicNone";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "none";
|
||||
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
|
||||
}
|
||||
//QUIC+srtp伪装模式被选中
|
||||
else if (RadioButtonQuicSRTP.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "QuicSRTP";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "srtp";
|
||||
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
|
||||
}
|
||||
//QUIC+utp伪装模式被选中
|
||||
else if (RadioButtonQuic2uTP.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "Quic2uTP";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "utp";
|
||||
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
|
||||
}
|
||||
//QUIC+wechat-video伪装模式被选中
|
||||
else if (RadioButtonQuicWechatVideo.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "QuicWechatVideo";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "wechat-video";
|
||||
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
|
||||
}
|
||||
//QUIC+dtls伪装模式被选中
|
||||
else if (RadioButtonQuicDTLS.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "QuicDTLS";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "dtls";
|
||||
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
|
||||
}
|
||||
//QUIC+wireguard伪装模式被选中
|
||||
else if (RadioButtonQuicWireGuard.IsChecked == true)
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "QuicWireGuard";
|
||||
MainWindow.ReceiveConfigurationParameters[5] = "wireguard";
|
||||
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
|
||||
}
|
||||
//默认模式为 TCP
|
||||
else
|
||||
{
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "TCP";
|
||||
}
|
||||
//传递服务端口
|
||||
MainWindow.ReceiveConfigurationParameters[1] = TextBoxServerListenPort.Text.ToString();
|
||||
//传递uuid
|
||||
MainWindow.ReceiveConfigurationParameters[2] = TextBoxNewUUID.Text.ToString();
|
||||
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void ButtondCancel_Click(object sender, RoutedEventArgs e) => Close();
|
||||
|
||||
#region 其他设置中的界面控制
|
||||
private void RadioButtonTCP_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//TextBlockServerListenPort.Visibility = Visibility.Visible;
|
||||
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||
//隐藏QUIC密钥
|
||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||
//隐藏Path
|
||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||
ButtonPath.Visibility = Visibility.Collapsed;
|
||||
//隐藏域名
|
||||
TextBlockDomain.Visibility = Visibility.Collapsed;
|
||||
TextBoxDomain.Visibility = Visibility.Collapsed;
|
||||
ButtonDomain.Visibility = Visibility.Collapsed;
|
||||
//隐藏伪装网站
|
||||
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||
|
||||
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
Random random = new Random();
|
||||
int randomServerPort = random.Next(10000, 50000);
|
||||
TextBoxServerListenPort.Text = randomServerPort.ToString();
|
||||
//清除其他选项卡中的选项
|
||||
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
}
|
||||
private void RadioButtonTCPhttp_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//TextBlockServerListenPort.Visibility = Visibility.Visible;
|
||||
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||
TextBoxServerListenPort.Text = "80";
|
||||
//隐藏Path
|
||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||
ButtonPath.Visibility = Visibility.Collapsed;
|
||||
|
||||
//隐藏域名
|
||||
TextBlockDomain.Visibility = Visibility.Collapsed;
|
||||
TextBoxDomain.Visibility = Visibility.Collapsed;
|
||||
ButtonDomain.Visibility = Visibility.Collapsed;
|
||||
//隐藏QUIC密钥
|
||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||
//隐藏伪装网站
|
||||
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
//清除其他选项卡中的选项
|
||||
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
}
|
||||
private void RadioButtonTCP2TLS_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TextBoxServerListenPort.Text = "443";
|
||||
//隐藏Path
|
||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||
//TextBoxPath.Text = "/ray";
|
||||
ButtonPath.Visibility = Visibility.Collapsed;
|
||||
//显示域名
|
||||
TextBlockDomain.Visibility = Visibility.Visible;
|
||||
TextBoxDomain.Visibility = Visibility.Visible;
|
||||
//ButtonDomain.Visibility = Visibility.Visible;
|
||||
//隐藏QUIC密钥
|
||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||
//隐藏伪装网站
|
||||
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
//清除其他选项卡中的选项
|
||||
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
}
|
||||
private void RadioButtonTCP2TLSnoDomain_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TextBoxServerListenPort.Text = "443";
|
||||
//隐藏Path
|
||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||
//TextBoxPath.Text = "/ray";
|
||||
ButtonPath.Visibility = Visibility.Collapsed;
|
||||
//隐藏域名
|
||||
TextBlockDomain.Visibility = Visibility.Collapsed;
|
||||
TextBoxDomain.Visibility = Visibility.Collapsed;
|
||||
//ButtonDomain.Visibility = Visibility.Visible;
|
||||
//隐藏QUIC密钥
|
||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||
//隐藏伪装网站
|
||||
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
//清除其他选项卡中的选项
|
||||
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
}
|
||||
private void RadioButtonWebSocketTLS2Web_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//TextBlockServerListenPort.Visibility = Visibility.Visible;
|
||||
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||
TextBoxServerListenPort.Text = "443";
|
||||
//显示Path
|
||||
TextBlockPath.Visibility = Visibility.Visible;
|
||||
TextBoxPath.Visibility = Visibility.Visible;
|
||||
TextBoxPath.Text = "/ray";
|
||||
ButtonPath.Visibility = Visibility.Visible;
|
||||
//显示域名
|
||||
TextBlockDomain.Visibility = Visibility.Visible;
|
||||
TextBoxDomain.Visibility = Visibility.Visible;
|
||||
//ButtonDomain.Visibility = Visibility.Visible;
|
||||
//隐藏QUIC密钥
|
||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||
//显示伪装网站
|
||||
TextBlockMaskSites.Visibility = Visibility.Visible;
|
||||
TextBoxMaskSites.Visibility = Visibility.Visible;
|
||||
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
//清除其他选项卡中的选项
|
||||
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
}
|
||||
private void RadioButtonWebSocketTLSselfSigned_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//TextBlockServerListenPort.Visibility = Visibility.Visible;
|
||||
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||
TextBoxServerListenPort.Text = "443";
|
||||
//显示Path
|
||||
TextBlockPath.Visibility = Visibility.Visible;
|
||||
TextBoxPath.Visibility = Visibility.Visible;
|
||||
TextBoxPath.Text = "/ray";
|
||||
ButtonPath.Visibility = Visibility.Visible;
|
||||
//隐藏域名
|
||||
TextBlockDomain.Visibility = Visibility.Collapsed;
|
||||
TextBoxDomain.Visibility = Visibility.Collapsed;
|
||||
//TextBoxDomain.Tag = "可为空";
|
||||
//ButtonDomain.Visibility = Visibility.Visible;
|
||||
//隐藏QUIC密钥
|
||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||
//隐藏伪装网站
|
||||
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
//清除其他选项卡中的选项
|
||||
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
}
|
||||
private void RadioButtonHTTP2_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//TextBlockServerListenPort.Visibility = Visibility.Visible;
|
||||
//TextBoxServerListenPort.Visibility = Visibility.Visible;
|
||||
//ButtonServerListenPort.Visibility = Visibility.Visible;
|
||||
TextBoxServerListenPort.Text = "443";
|
||||
//显示Path
|
||||
TextBlockPath.Visibility = Visibility.Visible;
|
||||
TextBoxPath.Visibility = Visibility.Visible;
|
||||
TextBoxPath.Text = "/ray";
|
||||
ButtonPath.Visibility = Visibility.Visible;
|
||||
//显示域名
|
||||
TextBlockDomain.Visibility = Visibility.Visible;
|
||||
TextBoxDomain.Visibility = Visibility.Visible;
|
||||
//ButtonDomain.Visibility = Visibility.Visible;
|
||||
//隐藏QUIC密钥
|
||||
TextBlockQuicUUID.Visibility = Visibility.Collapsed;
|
||||
TextBoxQuicUUID.Visibility = Visibility.Collapsed;
|
||||
ButtonQuicUUID.Visibility = Visibility.Collapsed;
|
||||
//隐藏伪装网站
|
||||
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
//清除其他选项卡中的选项
|
||||
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
}
|
||||
private void RadioButtonQuicNone_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//显示QUIC密钥
|
||||
TextBlockQuicUUID.Visibility = Visibility.Visible;
|
||||
TextBoxQuicUUID.Visibility = Visibility.Visible;
|
||||
ButtonQuicUUID.Visibility = Visibility.Visible;
|
||||
//隐藏Path
|
||||
TextBlockPath.Visibility = Visibility.Collapsed;
|
||||
TextBoxPath.Visibility = Visibility.Collapsed;
|
||||
ButtonPath.Visibility = Visibility.Collapsed;
|
||||
//隐藏域名
|
||||
TextBlockDomain.Visibility = Visibility.Collapsed;
|
||||
TextBoxDomain.Visibility = Visibility.Collapsed;
|
||||
ButtonDomain.Visibility = Visibility.Collapsed;
|
||||
//隐藏伪装网站
|
||||
TextBlockMaskSites.Visibility = Visibility.Collapsed;
|
||||
TextBoxMaskSites.Visibility = Visibility.Collapsed;
|
||||
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
|
||||
uuid = Guid.NewGuid();
|
||||
TextBoxQuicUUID.Text = uuid.ToString();
|
||||
|
||||
Random random = new Random();
|
||||
int randomServerPort = random.Next(10000, 50000);
|
||||
TextBoxServerListenPort.Text = randomServerPort.ToString();
|
||||
//清除其他选项卡中的选项
|
||||
UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
}
|
||||
#endregion
|
||||
|
||||
//产生随机的uuid
|
||||
private void ButtonNewUUID_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
}
|
||||
//产生QUIC密钥所用的UUID
|
||||
private void ButtonQuicUUID_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxQuicUUID.Text = uuid.ToString();
|
||||
}
|
||||
//产生随机服务端口
|
||||
private void ButtonServerListenPort_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Random random = new Random();
|
||||
int randomServerPort = random.Next(10000, 50000);
|
||||
TextBoxServerListenPort.Text = randomServerPort.ToString();
|
||||
}
|
||||
//产生随机的Path
|
||||
private void ButtonPath_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Random random = new Random();
|
||||
int randomSerialNum = random.Next(0, 4);
|
||||
Guid uuid = Guid.NewGuid();
|
||||
string[] pathArray = uuid.ToString().Split('-');
|
||||
string path = pathArray[randomSerialNum];
|
||||
TextBoxPath.Text = $"/{path}";
|
||||
//MessageBox.Show(path);
|
||||
}
|
||||
|
||||
private void ButtonDomain_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//private void ButtonTestChecked_Click(object sender, RoutedEventArgs e)
|
||||
//{
|
||||
// UncheckLayouts((TabItem)TabControlTemplate.SelectedItem);
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
69
ProxySU/TrojanResultClientInfoWindow.xaml
Normal file
69
ProxySU/TrojanResultClientInfoWindow.xaml
Normal file
|
@ -0,0 +1,69 @@
|
|||
<Window x:Class="ProxySU.TrojanResultClientInfoWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
mc:Ignorable="d"
|
||||
Title="TrojanResultClientInfoWindow" Height="550" Width="400">
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.7*"></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition Height="0.2*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Header="服务器连接参数" Grid.Row="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="服务器地址:" Grid.Column="0" Grid.Row="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxTrojanServerHost" Grid.Column="1" Grid.Row="1" Margin="4"></TextBox>
|
||||
<TextBlock Grid.Column="2" Grid.Row="1"></TextBlock>
|
||||
<TextBlock Text="端口:" Grid.Column="0" Grid.Row="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxTrojanServerPort" Grid.Column="1" Grid.Row="2" Margin="4"></TextBox>
|
||||
<TextBlock Grid.Column="2" Grid.Row="2"></TextBlock>
|
||||
<TextBlock Text="密钥:" Grid.Column="0" Grid.Row="3"></TextBlock>
|
||||
<TextBox x:Name="TextBoxTrojanServerPassword" Grid.Column="1" Grid.Row="3" Margin="4"></TextBox>
|
||||
<TextBlock Grid.Column="2" Grid.Row="3"></TextBlock>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="二维码/URL" Grid.Row="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="0.4*"></ColumnDefinition>
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.2*"></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="可用于ShadowRocket (ios)、igniter(Android)、Trojan-QT5 (windows) 扫码和导入url" TextWrapping="Wrap" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"></TextBlock>
|
||||
<Image x:Name="ImageTrojanShareQRurl" Grid.Column="0" Grid.Row="1"></Image>
|
||||
<TextBox x:Name="TextBoxTrojanUrl" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1"></TextBox>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="ButtonTrojanResultOpen" Content="确定" Grid.Column="1" Margin="4" Click="ButtonTrojanResultOpen_Click"></Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
151
ProxySU/TrojanResultClientInfoWindow.xaml.cs
Normal file
151
ProxySU/TrojanResultClientInfoWindow.xaml.cs
Normal file
|
@ -0,0 +1,151 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
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.Shapes;
|
||||
using System.IO;
|
||||
using Renci.SshNet;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Drawing;
|
||||
using QRCoder;
|
||||
|
||||
namespace ProxySU
|
||||
{
|
||||
/// <summary>
|
||||
/// TrojanResultClientInfoWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TrojanResultClientInfoWindow : Window
|
||||
{
|
||||
private string saveFileFolder = "";
|
||||
public TrojanResultClientInfoWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
//主机地址
|
||||
TextBoxTrojanServerHost.Text = MainWindow.ReceiveConfigurationParameters[4];
|
||||
//主机端口
|
||||
TextBoxTrojanServerPort.Text = MainWindow.ReceiveConfigurationParameters[1];
|
||||
//密钥(uuid)
|
||||
TextBoxTrojanServerPassword.Text = MainWindow.ReceiveConfigurationParameters[2];
|
||||
|
||||
GenerateV2rayShareQRcodeAndBase64Url();
|
||||
|
||||
}
|
||||
|
||||
//生成v2rayN客户端导入文件
|
||||
private void GenerateV2rayShareQRcodeAndBase64Url()
|
||||
{
|
||||
|
||||
string saveFileFolderFirst = TextBoxTrojanServerHost.Text;
|
||||
int num = 1;
|
||||
saveFileFolder = saveFileFolderFirst;
|
||||
CheckDir("trojan_config");
|
||||
while (Directory.Exists(@"trojan_config\" + saveFileFolder))
|
||||
{
|
||||
saveFileFolder = saveFileFolderFirst + "_copy_" + num.ToString();
|
||||
num++;
|
||||
}
|
||||
CheckDir(@"trojan_config\" + saveFileFolder);
|
||||
string trojanUrl = $"trojan://{TextBoxTrojanServerPassword.Text}@{TextBoxTrojanServerHost.Text}:{TextBoxTrojanServerPort.Text}#{TextBoxTrojanServerHost.Text}";
|
||||
//MessageBox.Show(v2rayNjsonObject.ToString());
|
||||
//string trojanUrl = "trojan://" + ToBase64Encode(v2rayNjsonObject.ToString());
|
||||
TextBoxTrojanUrl.Text = trojanUrl;
|
||||
using (StreamWriter sw = new StreamWriter($"trojan_config\\{saveFileFolder}\\url.txt"))
|
||||
{
|
||||
sw.WriteLine(trojanUrl);
|
||||
|
||||
}
|
||||
CreateQRCode(trojanUrl);
|
||||
|
||||
//移动Trojan官方程序配置文件到相应目录
|
||||
if (File.Exists(@"trojan_config\config.json"))
|
||||
{
|
||||
File.Move(@"trojan_config\config.json", @"trojan_config\" + saveFileFolder + @"\config.json");
|
||||
//File.Delete(@"config\config.json");//删除该文件
|
||||
}
|
||||
|
||||
using (StreamWriter sw = new StreamWriter($"trojan_config\\{saveFileFolder}\\说明.txt"))
|
||||
{
|
||||
sw.WriteLine("config.json");
|
||||
sw.WriteLine("此文件为Trojan官方程序所使用的客户端配置文件,配置为全局模式,socks5地址:127.0.0.1:1080");
|
||||
sw.WriteLine("Trojan官方网站:https://trojan-gfw.github.io/trojan/");
|
||||
sw.WriteLine("Trojan官方程序下载地址:https://github.com/trojan-gfw/trojan/releases");
|
||||
sw.WriteLine("下载相应版本,Windows选择Trojan-x.xx-win.zip,解压后提取trojan.exe。与config.json放在同一目录,运行trojan.exe即可。");
|
||||
sw.WriteLine("-----------------------------------------\n");
|
||||
sw.WriteLine("QR.bmp");
|
||||
sw.WriteLine("此文件为Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)扫码导入节点");
|
||||
sw.WriteLine("Trojan-QT5 (windows)下载网址:https://github.com/TheWanderingCoel/Trojan-Qt5/releases");
|
||||
sw.WriteLine("igniter(Android)下载网址:https://github.com/trojan-gfw/igniter/releases");
|
||||
sw.WriteLine("Shadowrocket(ios)下载,需要使用国外区的AppleID。请自行谷歌方法。");
|
||||
|
||||
sw.WriteLine("-----------------------------------------\n");
|
||||
sw.WriteLine("url.txt");
|
||||
sw.WriteLine("此文件为Trojan-QT5 (windows)、igniter(Android)、Shadowrocket(ios)复制粘贴导入节点的网址");
|
||||
sw.WriteLine("-----------------------------------------\n");
|
||||
sw.WriteLine("服务器通用连接配置参数");
|
||||
sw.WriteLine($"地址(address):{TextBoxTrojanServerHost.Text}");
|
||||
sw.WriteLine($"端口(Port):{TextBoxTrojanServerPort.Text}");
|
||||
sw.WriteLine($"密钥:{TextBoxTrojanServerPassword.Text}");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
//生成base64
|
||||
//private string ToBase64Encode(string text)
|
||||
//{
|
||||
// if (String.IsNullOrEmpty(text))
|
||||
// {
|
||||
// return text;
|
||||
// }
|
||||
|
||||
// byte[] textBytes = Encoding.UTF8.GetBytes(text);
|
||||
// return Convert.ToBase64String(textBytes);
|
||||
//}
|
||||
|
||||
//生成QRcoder图片
|
||||
private void CreateQRCode(string varBase64)
|
||||
{
|
||||
//string varBase64 = varBase64;
|
||||
QRCodeGenerator qrGenerator = new QRCodeGenerator();
|
||||
QRCodeData qrCodeData = qrGenerator.CreateQrCode(varBase64, QRCodeGenerator.ECCLevel.Q);
|
||||
QRCode qrCode = new QRCode(qrCodeData);
|
||||
Bitmap qrCodeImage = qrCode.GetGraphic(20);
|
||||
IntPtr myImagePtr = qrCodeImage.GetHbitmap();
|
||||
BitmapSource imgsource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(myImagePtr, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
|
||||
ImageTrojanShareQRurl.Source = imgsource;
|
||||
//DeleteObject(myImagePtr);
|
||||
qrCodeImage.Save($"trojan_config\\{saveFileFolder}\\QR.bmp");
|
||||
|
||||
}
|
||||
//判断目录是否存在,不存在则创建
|
||||
private static bool CheckDir(string folder)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(folder))//如果不存在就创建file文件夹
|
||||
Directory.CreateDirectory(folder);//创建该文件夹
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private void ButtonTrojanResultOpen_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string openFolderPath = @"trojan_config\" + saveFileFolder;
|
||||
System.Diagnostics.Process.Start("explorer.exe", openFolderPath);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
104
ProxySU/TrojanTemplateWindow.xaml
Normal file
104
ProxySU/TrojanTemplateWindow.xaml
Normal file
|
@ -0,0 +1,104 @@
|
|||
<Window x:Class="ProxySU.TrojanTemplateWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
mc:Ignorable="d"
|
||||
Title="TrojanTemplateWindow" Height="400" Width="600">
|
||||
<Window.Resources>
|
||||
<Style BasedOn="{StaticResource {x:Type TextBox}}"
|
||||
TargetType="TextBox"
|
||||
x:Key="TitleText">
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Text" Value=""/>
|
||||
<Condition Property="TextBox.IsFocused" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="Gray" Margin="0">
|
||||
<TextBlock x:Name="MainTextBlock" Text="{TemplateBinding TextBox.Tag}" Width="{TemplateBinding TextBox.ActualWidth}" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</MultiTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.7*"></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Header="模板库" Grid.Row="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton x:Name="RadioButtonTrojanTLS2Web" Content="Trojan+TLS+Web" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTrojanTLS2Web_Checked"></RadioButton>
|
||||
<TextBlock Text="说明" Grid.Column="1" Grid.Row="1"></TextBlock>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="其他设置" Grid.Row="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.3*"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="0.4*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="0.4*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock x:Name="TextBlockDomain" Text="域名:" Grid.Column="0" Grid.Row="0" ></TextBlock>
|
||||
<TextBox x:Name="TextBoxDomain" Style="{StaticResource TitleText}" Tag="不可为空" Grid.Column="1" Grid.Row="0" Margin="3"></TextBox>
|
||||
<!--<Button x:Name="ButtonDomain" Content="检测" Visibility="Collapsed" Grid.Column="2" Grid.Row="0" Margin="2" Click="ButtonDomain_Click"></Button>-->
|
||||
<TextBlock x:Name="TextBlockServerListenPort" Text="服务端口:" Grid.Column="0" Grid.Row="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxServerListenPort" Grid.Column="1" Grid.Row="1" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonServerListenPort" Content="随机选择" Grid.Column="2" Grid.Row="1" Margin="2" Click="ButtonServerListenPort_Click"></Button>
|
||||
|
||||
<TextBlock x:Name="TextBlockNewUUID" Text="密码:" Grid.Column="0" Grid.Row="2" ></TextBlock>
|
||||
<TextBox x:Name="TextBoxNewUUID" Grid.Column="1" Grid.Row="2" Margin="3"></TextBox>
|
||||
<Button x:Name="ButtonNewUUID" Content="更新" Grid.Column="2" Grid.Row="2" Margin="3" Click="ButtonNewUUID_Click"></Button>
|
||||
<TextBlock Text="使用已有密码,直接粘贴到框中" TextWrapping="Wrap" Grid.Column="3" Grid.Row="2"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockMaskSites" Text="伪装网站:" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"></TextBlock>
|
||||
<TextBox x:Name="TextBoxMaskSites" Style="{StaticResource TitleText}" Tag="设置此项可增加代理的隐蔽(可为空)" Grid.Column="1" Grid.Row="3" Margin="3"></TextBox>
|
||||
<Grid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="ButtondDecide" Content="确定" Grid.Column="1" Grid.Row="6" Margin="3" Click="ButtondDecide_Click"></Button>
|
||||
<Button x:Name="ButtondCancel" Content="取消" Grid.Column="3" Grid.Row="6" Margin="3" Click="ButtondCancel_Click"></Button>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
87
ProxySU/TrojanTemplateWindow.xaml.cs
Normal file
87
ProxySU/TrojanTemplateWindow.xaml.cs
Normal file
|
@ -0,0 +1,87 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
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.Shapes;
|
||||
|
||||
namespace ProxySU
|
||||
{
|
||||
/// <summary>
|
||||
/// TrojanTemplateWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TrojanTemplateWindow : Window
|
||||
{
|
||||
public TrojanTemplateWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
RadioButtonTrojanTLS2Web.IsChecked = true;
|
||||
}
|
||||
private void ButtondDecide_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (RadioButtonTrojanTLS2Web.IsChecked == true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TextBoxDomain.Text.ToString()) == true)
|
||||
{
|
||||
MessageBox.Show("域名不能为空!");
|
||||
return;
|
||||
}
|
||||
//传递模板类型
|
||||
MainWindow.ReceiveConfigurationParameters[0] = "TrojanTLS2Web";
|
||||
|
||||
//传递域名
|
||||
MainWindow.ReceiveConfigurationParameters[4] = TextBoxDomain.Text.ToString();
|
||||
//传递伪装网站
|
||||
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.ToString();
|
||||
//处理伪装网站域名中的前缀
|
||||
if (TextBoxMaskSites.Text.ToString().Length >= 7)
|
||||
{
|
||||
string testDomain = TextBoxMaskSites.Text.Substring(0, 7);
|
||||
if (String.Equals(testDomain, "https:/") || String.Equals(testDomain, "http://"))
|
||||
{
|
||||
//MessageBox.Show(testDomain);
|
||||
MainWindow.ReceiveConfigurationParameters[7] = TextBoxMaskSites.Text.Replace("/", "\\/");
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow.ReceiveConfigurationParameters[7] = "http:\\/\\/" + TextBoxMaskSites.Text;
|
||||
}
|
||||
}
|
||||
//传递服务端口
|
||||
MainWindow.ReceiveConfigurationParameters[1] = TextBoxServerListenPort.Text.ToString();
|
||||
//传递密码(uuid)
|
||||
MainWindow.ReceiveConfigurationParameters[2] = TextBoxNewUUID.Text.ToString();
|
||||
}
|
||||
|
||||
|
||||
this.Close();
|
||||
}
|
||||
private void ButtonNewUUID_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
}
|
||||
private void ButtonServerListenPort_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Random random = new Random();
|
||||
int randomServerPort = random.Next(10000, 50000);
|
||||
TextBoxServerListenPort.Text = randomServerPort.ToString();
|
||||
}
|
||||
private void ButtondCancel_Click(object sender, RoutedEventArgs e) => Close();
|
||||
|
||||
private void RadioButtonTrojanTLS2Web_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Guid uuid = Guid.NewGuid();
|
||||
TextBoxNewUUID.Text = uuid.ToString();
|
||||
//Random random = new Random();
|
||||
//int randomServerPort = random.Next(10000, 50000);
|
||||
TextBoxServerListenPort.Text = "443";
|
||||
}
|
||||
}
|
||||
}
|
BIN
ProxySU/bin/Release/Newtonsoft.Json.dll
Normal file
BIN
ProxySU/bin/Release/Newtonsoft.Json.dll
Normal file
Binary file not shown.
BIN
ProxySU/bin/Release/ProxySU.exe
Normal file
BIN
ProxySU/bin/Release/ProxySU.exe
Normal file
Binary file not shown.
BIN
ProxySU/bin/Release/QRCoder.dll
Normal file
BIN
ProxySU/bin/Release/QRCoder.dll
Normal file
Binary file not shown.
BIN
ProxySU/bin/Release/Release.zip
Normal file
BIN
ProxySU/bin/Release/Release.zip
Normal file
Binary file not shown.
BIN
ProxySU/bin/Release/Renci.SshNet.dll
Normal file
BIN
ProxySU/bin/Release/Renci.SshNet.dll
Normal file
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"listen": "socks://127.0.0.1:1080",
|
||||
"proxy": "",
|
||||
"padding": true,
|
||||
"log": ""
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
##domain## {
|
||||
log stdout
|
||||
errors stderr
|
||||
root /var/www
|
||||
tls off
|
||||
##sites##
|
||||
forwardproxy {
|
||||
##basicauth##
|
||||
probe_resistance
|
||||
hide_ip
|
||||
hide_via
|
||||
upstream http://127.0.0.1:8383
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"listen": "http://127.0.0.1:8383",
|
||||
"padding": true
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"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": "ws",
|
||||
"security": "tls",
|
||||
"wsSettings": {
|
||||
"path": null
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
##domain## {
|
||||
log stdout
|
||||
errors stderr
|
||||
root /var/www
|
||||
tls off
|
||||
##sites##
|
||||
proxy ##path## localhost:10000 {
|
||||
websocket
|
||||
header_upstream -Origin
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 10000,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"wsSettings": {
|
||||
"path": null
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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": "ws",
|
||||
"wsSettings": {
|
||||
"path": null
|
||||
},
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"allowInsecure": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"certificates": [
|
||||
{}
|
||||
]
|
||||
},
|
||||
"network": "ws",
|
||||
"wsSettings": {
|
||||
"path": null
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"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": {
|
||||
"security": "tls",
|
||||
"network": "ws",
|
||||
"wsSettings": {
|
||||
"path": null
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/etc/v2ray/ssl/v2ray_ssl.crt",
|
||||
"keyFile": "/etc/v2ray/ssl/v2ray_ssl.key"
|
||||
}
|
||||
]
|
||||
},
|
||||
"network": "ws",
|
||||
"wsSettings": {
|
||||
"path": null
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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,
|
||||
"host": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
##domain## {
|
||||
log stdout
|
||||
errors stderr
|
||||
root /var/www
|
||||
tls off
|
||||
##sites##
|
||||
proxy ##path## https://localhost:10000 {
|
||||
insecure_skip_verify
|
||||
header_upstream Host {host}
|
||||
header_upstream X-Real-IP {remote}
|
||||
header_upstream X-Forwarded-For {remote}
|
||||
header_upstream X-Forwarded-Port {server_port}
|
||||
header_upstream X-Forwarded-Proto "https"
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 10000,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "h2",
|
||||
"security": "tls",
|
||||
"httpSettings": {
|
||||
"path": null,
|
||||
"host": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"tlsSettings": {
|
||||
"certificates": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
49
ProxySU/bin/Release/TemplateConfg/http2_client_config.json
Normal file
49
ProxySU/bin/Release/TemplateConfg/http2_client_config.json
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
37
ProxySU/bin/Release/TemplateConfg/http2_server_config.json
Normal file
37
ProxySU/bin/Release/TemplateConfg/http2_server_config.json
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "h2",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/etc/v2ray/ssl/v2ray_ssl.crt",
|
||||
"keyFile": "/etc/v2ray/ssl/v2ray_ssl.key"
|
||||
}
|
||||
]
|
||||
},
|
||||
"httpSettings": {
|
||||
"path": null
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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",
|
||||
"httpSettings": {
|
||||
"path": null
|
||||
},
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"allowInsecure": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
53
ProxySU/bin/Release/TemplateConfg/mkcp_client_config.json
Normal file
53
ProxySU/bin/Release/TemplateConfg/mkcp_client_config.json
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"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": "kcp",
|
||||
"kcpSettings": {
|
||||
"uplinkCapacity": 100,
|
||||
"downlinkCapacity": 100,
|
||||
"congestion": true,
|
||||
"header": {
|
||||
"type": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
33
ProxySU/bin/Release/TemplateConfg/mkcp_server_config.json
Normal file
33
ProxySU/bin/Release/TemplateConfg/mkcp_server_config.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "mkcp",
|
||||
"kcpSettings": {
|
||||
"uplinkCapacity": 100,
|
||||
"downlinkCapacity": 100,
|
||||
"congestion": true,
|
||||
"header": {
|
||||
"type": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
51
ProxySU/bin/Release/TemplateConfg/quic_client_config.json
Normal file
51
ProxySU/bin/Release/TemplateConfg/quic_client_config.json
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "quic",
|
||||
"quicSettings": {
|
||||
"security": "chacha20-poly1305",
|
||||
"key": null,
|
||||
"header": {
|
||||
"type": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
33
ProxySU/bin/Release/TemplateConfg/quic_server_config.json
Normal file
33
ProxySU/bin/Release/TemplateConfg/quic_server_config.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "quic",
|
||||
"quicSettings": {
|
||||
"security": "chacha20-poly1305",
|
||||
"key": null,
|
||||
"header": {
|
||||
"type": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"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": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"allowInsecure": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"certificates": [
|
||||
{}
|
||||
]
|
||||
},
|
||||
"network": "tcp"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
46
ProxySU/bin/Release/TemplateConfg/tcp_TLS_client_config.json
Normal file
46
ProxySU/bin/Release/TemplateConfg/tcp_TLS_client_config.json
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"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": "tcp",
|
||||
"security": "tls"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
34
ProxySU/bin/Release/TemplateConfg/tcp_TLS_server_config.json
Normal file
34
ProxySU/bin/Release/TemplateConfg/tcp_TLS_server_config.json
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/etc/v2ray/ssl/v2ray_ssl.crt",
|
||||
"keyFile": "/etc/v2ray/ssl/v2ray_ssl.key"
|
||||
}
|
||||
]
|
||||
},
|
||||
"network": "tcp"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
45
ProxySU/bin/Release/TemplateConfg/tcp_client_config.json
Normal file
45
ProxySU/bin/Release/TemplateConfg/tcp_client_config.json
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"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": "tcp"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"tcpSettings": {
|
||||
"header": {
|
||||
"type": "http",
|
||||
"request": {
|
||||
"version": "1.1",
|
||||
"method": "GET",
|
||||
"path": [
|
||||
"/"
|
||||
],
|
||||
"headers": {
|
||||
"Host": [
|
||||
"www.cloudflare.com",
|
||||
"www.amazon.com",
|
||||
"www.microsoft.com",
|
||||
"www.intel.com"
|
||||
],
|
||||
"User-Agent": [
|
||||
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
|
||||
"Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
|
||||
],
|
||||
"Accept-Encoding": [
|
||||
"gzip, deflate"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Pragma": "no-cache"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"tcpSettings": {
|
||||
"header": {
|
||||
"type": "http",
|
||||
"response": {
|
||||
"version": "1.1",
|
||||
"status": "200",
|
||||
"reason": "OK",
|
||||
"headers": {
|
||||
"Content-Type": [
|
||||
"application/octet-stream",
|
||||
"application/x-msdownload",
|
||||
"text/html",
|
||||
"application/x-shockwave-flash"
|
||||
],
|
||||
"Transfer-Encoding": [
|
||||
"chunked"
|
||||
],
|
||||
"Connection": [
|
||||
"keep-alive"
|
||||
],
|
||||
"Pragma": "no-cache"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
22
ProxySU/bin/Release/TemplateConfg/tcp_server_config.json
Normal file
22
ProxySU/bin/Release/TemplateConfg/tcp_server_config.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
##domain## {
|
||||
log stdout
|
||||
errors stderr
|
||||
root /var/www
|
||||
tls off
|
||||
##sites##
|
||||
}
|
31
ProxySU/bin/Release/TemplateConfg/trojan_client_config.json
Normal file
31
ProxySU/bin/Release/TemplateConfg/trojan_client_config.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"run_type": "client",
|
||||
"local_addr": "127.0.0.1",
|
||||
"local_port": 1080,
|
||||
"remote_addr": null,
|
||||
"remote_port": 443,
|
||||
"password": [
|
||||
""
|
||||
],
|
||||
"log_level": 1,
|
||||
"ssl": {
|
||||
"verify": true,
|
||||
"verify_hostname": true,
|
||||
"cert": "",
|
||||
"cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:RSA-AES128-GCM-SHA256:RSA-AES256-GCM-SHA384:RSA-AES128-SHA:RSA-AES256-SHA:RSA-3DES-EDE-SHA",
|
||||
"sni": "",
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"reuse_session": true,
|
||||
"session_ticket": false,
|
||||
"curves": ""
|
||||
},
|
||||
"tcp": {
|
||||
"no_delay": true,
|
||||
"keep_alive": true,
|
||||
"fast_open": false,
|
||||
"fast_open_qlen": 20
|
||||
}
|
||||
}
|
11
ProxySU/bin/Release/TemplateConfg/trojan_nginx_config.nginx
Normal file
11
ProxySU/bin/Release/TemplateConfg/trojan_nginx_config.nginx
Normal file
|
@ -0,0 +1,11 @@
|
|||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name ##domain##;
|
||||
root /var/www/html;
|
||||
index index.html index.htm;
|
||||
location / {
|
||||
proxy_pass ##sites##;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
42
ProxySU/bin/Release/TemplateConfg/trojan_server_config.json
Normal file
42
ProxySU/bin/Release/TemplateConfg/trojan_server_config.json
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"run_type": "server",
|
||||
"local_addr": "0.0.0.0",
|
||||
"local_port": 443,
|
||||
"remote_addr": "127.0.0.1",
|
||||
"remote_port": 80,
|
||||
"password": [
|
||||
""
|
||||
],
|
||||
"log_level": 1,
|
||||
"ssl": {
|
||||
"cert": "/usr/local/etc/trojan/trojan_ssl.crt",
|
||||
"key": "/usr/local/etc/trojan/trojan_ssl.key",
|
||||
"key_password": "",
|
||||
"cipher": "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256",
|
||||
"prefer_server_cipher": true,
|
||||
"alpn": [
|
||||
"http/1.1"
|
||||
],
|
||||
"reuse_session": true,
|
||||
"session_ticket": false,
|
||||
"session_timeout": 600,
|
||||
"plain_http_response": "",
|
||||
"curves": "",
|
||||
"dhparam": ""
|
||||
},
|
||||
"tcp": {
|
||||
"prefer_ipv4": false,
|
||||
"no_delay": true,
|
||||
"keep_alive": true,
|
||||
"fast_open": false,
|
||||
"fast_open_qlen": 20
|
||||
},
|
||||
"mysql": {
|
||||
"enabled": false,
|
||||
"server_addr": "127.0.0.1",
|
||||
"server_port": 3306,
|
||||
"database": "trojan",
|
||||
"username": "trojan",
|
||||
"password": ""
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"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": "ws"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"port": null,
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": null,
|
||||
"alterId": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
|
||||
namespace ProxySuper.Core
|
||||
{
|
||||
public class App : MvxApplication
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
RegisterAppStart<HomeViewModel>();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
using ProxySuper.Core.Models.Hosts;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace ProxySuper.Core.Converters
|
||||
{
|
||||
public class LoginSecretTypeConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value.Equals(parameter);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (parameter == null) return LoginSecretType.Password;
|
||||
return parameter;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace ProxySuper.Core.Converters
|
||||
{
|
||||
public class ProxyTypeConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value != null && value.Equals(parameter);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return Binding.DoNothing;
|
||||
}
|
||||
|
||||
if (!value.Equals(true))
|
||||
{
|
||||
return Binding.DoNothing;
|
||||
}
|
||||
|
||||
return parameter;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace ProxySuper.Core.Converters
|
||||
{
|
||||
public class VisibleConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value.Equals(true) ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value.Equals(Visibility.Visible))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace ProxySuper.Core.Helpers
|
||||
{
|
||||
public static class DateTimeUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// 从国家授时中心获取标准GMT时间,读取https://www.tsa.cn
|
||||
/// GMT时间与UTC时间没有差别,可以UTC=GMT
|
||||
/// </summary>
|
||||
/// <returns>返回网络时间</returns>
|
||||
public static DateTime GetUTCTime()
|
||||
{
|
||||
DateTime time;
|
||||
try
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.tsa.cn");
|
||||
request.Method = "HEAD";
|
||||
request.AllowAutoRedirect = false;
|
||||
HttpWebResponse reponse = (HttpWebResponse)request.GetResponse();
|
||||
string cc = reponse.GetResponseHeader("date");
|
||||
reponse.Close();
|
||||
|
||||
bool s = GMTStrParse(cc, out time);
|
||||
return time;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GMTStrParse(string gmtStr, out DateTime gmtTime) //抓取的date是GMT格式的字符串,这里转成datetime
|
||||
{
|
||||
CultureInfo enUS = new CultureInfo("en-US");
|
||||
bool s = DateTime.TryParseExact(gmtStr, "r", enUS, DateTimeStyles.None, out gmtTime);
|
||||
return s;
|
||||
}
|
||||
|
||||
//设置系统时间的API函数
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern bool SetLocalTime(ref SYSTEMTIME time);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct SYSTEMTIME
|
||||
{
|
||||
public short year;
|
||||
public short month;
|
||||
public short dayOfWeek;
|
||||
public short day;
|
||||
public short hour;
|
||||
public short minute;
|
||||
public short second;
|
||||
public short milliseconds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置系统时间
|
||||
/// </summary>
|
||||
/// <param name="dt">需要设置的时间</param>
|
||||
/// <returns>返回系统时间设置状态,true为成功,false为失败</returns>
|
||||
public static bool SetDate(DateTime dt)
|
||||
{
|
||||
SYSTEMTIME st;
|
||||
|
||||
st.year = (short)dt.Year;
|
||||
st.month = (short)dt.Month;
|
||||
st.dayOfWeek = (short)dt.DayOfWeek;
|
||||
st.day = (short)dt.Day;
|
||||
st.hour = (short)dt.Hour;
|
||||
st.minute = (short)dt.Minute;
|
||||
st.second = (short)dt.Second;
|
||||
st.milliseconds = (short)dt.Millisecond;
|
||||
bool rt = SetLocalTime(ref st);
|
||||
return rt;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class Utils
|
||||
{
|
||||
public static string Base64Encode(string plainText)
|
||||
{
|
||||
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
|
||||
return System.Convert.ToBase64String(plainTextBytes);
|
||||
}
|
||||
|
||||
public static string Base64Decode(string base64EncodedData)
|
||||
{
|
||||
var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
|
||||
return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
|
||||
}
|
||||
|
||||
public static T DeepClone<T>(T obj) where T : class
|
||||
{
|
||||
var serialized = JsonConvert.SerializeObject(obj);
|
||||
return JsonConvert.DeserializeObject<T>(serialized);
|
||||
}
|
||||
|
||||
public static string GetTickID()
|
||||
{
|
||||
return DateTime.Now.Ticks.ToString();
|
||||
}
|
||||
|
||||
private static Random random = new Random();
|
||||
public static string RandomString(int length)
|
||||
{
|
||||
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
return new string(Enumerable.Repeat(chars, length)
|
||||
.Select(s => s[random.Next(s.Length)]).ToArray());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models
|
||||
{
|
||||
public static class Caddy
|
||||
{
|
||||
public static string Service = @"
|
||||
[Unit]
|
||||
Description=Caddy
|
||||
Documentation=https://caddyserver.com/docs/
|
||||
After=network.target network-online.target
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
#User=caddy
|
||||
#Group=caddy
|
||||
User=root
|
||||
Group=root
|
||||
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
|
||||
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
|
||||
TimeoutStopSec=5s
|
||||
#LimitNOFILE=1048576
|
||||
#LimitNPROC=512
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
";
|
||||
|
||||
public static string DefaultCaddyFile = @"
|
||||
:80 {
|
||||
respond ""Hello world!"";
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
using Microsoft.Win32;
|
||||
using MvvmCross.Commands;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Models.Hosts
|
||||
{
|
||||
public class Host
|
||||
{
|
||||
|
||||
public Host()
|
||||
{
|
||||
Proxy = new LocalProxy();
|
||||
}
|
||||
|
||||
|
||||
public string Tag { get; set; }
|
||||
|
||||
public string Address { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
public string Password { get; set; }
|
||||
|
||||
public int Port { get; set; } = 22;
|
||||
|
||||
public string PrivateKeyPath { get; set; }
|
||||
|
||||
public string PrivateKeyPassPhrase { get; set; }
|
||||
|
||||
public LocalProxy Proxy { get; set; }
|
||||
|
||||
public LoginSecretType SecretType { get; set; }
|
||||
|
||||
public IMvxCommand UploadPrivateKeyCommand => new MvxCommand(UploadPrivateKey);
|
||||
|
||||
private void UploadPrivateKey()
|
||||
{
|
||||
var fileDialog = new OpenFileDialog();
|
||||
fileDialog.FileOk += OnFileOk;
|
||||
fileDialog.ShowDialog();
|
||||
}
|
||||
|
||||
private void OnFileOk(object sender, CancelEventArgs e)
|
||||
{
|
||||
var file = sender as OpenFileDialog;
|
||||
PrivateKeyPath = file.FileName;
|
||||
|
||||
Task.Delay(300).ContinueWith((t) =>
|
||||
{
|
||||
MessageBox.Show("上传成功", "提示");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
using Renci.SshNet;
|
||||
|
||||
namespace ProxySuper.Core.Models.Hosts
|
||||
{
|
||||
public class LocalProxy
|
||||
{
|
||||
public string Address { get; set; } = "127.0.0.1";
|
||||
|
||||
public int Port { get; set; } = 1080;
|
||||
|
||||
public ProxyTypes Type { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
public string Password { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
namespace ProxySuper.Core.Models.Hosts
|
||||
{
|
||||
public enum LoginSecretType
|
||||
{
|
||||
Password = 0,
|
||||
PrivateKey = 1
|
||||
}
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models
|
||||
{
|
||||
public class ProjectProgress
|
||||
{
|
||||
private string _step;
|
||||
|
||||
private string _desc;
|
||||
|
||||
private int _percentage;
|
||||
|
||||
private string _logs;
|
||||
|
||||
public ProjectProgress()
|
||||
{
|
||||
_step = "步骤";
|
||||
|
||||
_desc = "步骤描述";
|
||||
|
||||
_percentage = 0;
|
||||
|
||||
_logs = string.Empty;
|
||||
|
||||
StepUpdate = () => { };
|
||||
}
|
||||
|
||||
|
||||
public Action StepUpdate { get; set; }
|
||||
|
||||
public Action LogsUpdate { get; set; }
|
||||
|
||||
public string Desc
|
||||
{
|
||||
get { return _desc; }
|
||||
set
|
||||
{
|
||||
_desc = value;
|
||||
StepUpdate();
|
||||
|
||||
_logs += _desc + "\n";
|
||||
LogsUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public string Step
|
||||
{
|
||||
get { return _step; }
|
||||
set
|
||||
{
|
||||
_step = value;
|
||||
StepUpdate();
|
||||
|
||||
_logs += Step + "\n";
|
||||
LogsUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public int Percentage
|
||||
{
|
||||
get { return _percentage; }
|
||||
set
|
||||
{
|
||||
_percentage = value;
|
||||
StepUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public string Logs
|
||||
{
|
||||
get { return _logs; }
|
||||
set
|
||||
{
|
||||
_logs = value;
|
||||
LogsUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public class BrookSettings : IProjectSettings
|
||||
{
|
||||
public string Domain { get; set; }
|
||||
|
||||
public string IP { get; set; }
|
||||
|
||||
public string Password { get; set; }
|
||||
|
||||
public BrookType BrookType { get; set; }
|
||||
|
||||
public int Port { get; set; } = 443;
|
||||
|
||||
public List<int> FreePorts
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Port == 443)
|
||||
{
|
||||
return new List<int> { 80, 443 };
|
||||
}
|
||||
return new List<int> { Port };
|
||||
}
|
||||
}
|
||||
|
||||
public string Email => "server@brook.com";
|
||||
|
||||
public ProjectType Type { get; set; } = ProjectType.Brook;
|
||||
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public enum BrookType
|
||||
{
|
||||
server,
|
||||
wsserver,
|
||||
wssserver,
|
||||
socks5
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public class HysteriaSettings : IProjectSettings
|
||||
{
|
||||
public string Domain { get; set; } = "";
|
||||
|
||||
public string Obfs { get; set; } = "";
|
||||
|
||||
public string Email { get; set; } = "";
|
||||
|
||||
public string Protocol { get; set; } = "udp";
|
||||
|
||||
public int Port { get; set; } = 36712;
|
||||
|
||||
public int UpMbps { get; set; } = 300;
|
||||
|
||||
public int DownMbps { get; set; } = 300;
|
||||
|
||||
public List<int> FreePorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<int> { Port, 80 };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public interface IProjectSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
string Domain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 额外需要开放的端口
|
||||
/// </summary>
|
||||
List<int> FreePorts { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
//ProjectType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
string Email { get; }
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public class MTProtoGoSettings : IProjectSettings
|
||||
{
|
||||
public MTProtoGoSettings()
|
||||
{
|
||||
Port = 443;
|
||||
|
||||
Domain = string.Empty;
|
||||
|
||||
Cleartext = "bing.com";
|
||||
|
||||
SecretText = string.Empty;
|
||||
}
|
||||
|
||||
public int Port { get; set; }
|
||||
|
||||
public string Domain { get; set; }
|
||||
|
||||
public List<int> FreePorts => new List<int> { Port };
|
||||
|
||||
public string Email => "";
|
||||
|
||||
public string Cleartext { get; set; }
|
||||
|
||||
public string SecretText { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public class NaiveProxySettings : IProjectSettings
|
||||
{
|
||||
public NaiveProxySettings()
|
||||
{
|
||||
Port = 443;
|
||||
}
|
||||
|
||||
public List<int> FreePorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<int> { 80, 443, Port }.Distinct().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public ProjectType Type { get; set; } = ProjectType.NaiveProxy;
|
||||
|
||||
public int Port { get; set; }
|
||||
|
||||
public string Domain { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
public string Password { get; set; }
|
||||
|
||||
public string MaskDomain { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Email
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Domain))
|
||||
{
|
||||
var arr = Domain.Split('.');
|
||||
if (arr.Length == 3)
|
||||
{
|
||||
return $"{arr[0]}@{arr[1]}.{arr[2]}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $"{UserName + Port.ToString()}@gmail.com";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public enum ProjectType
|
||||
{
|
||||
Xray = 0,
|
||||
TrojanGo = 1,
|
||||
NaiveProxy = 2,
|
||||
Brook = 3,
|
||||
V2ray = 4,
|
||||
MTProtoGo = 5,
|
||||
Hysteria = 6,
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public enum RayType
|
||||
{
|
||||
// 入口
|
||||
VLESS_TCP_XTLS = 100,
|
||||
|
||||
// VLESS 101开头
|
||||
VLESS_TCP = 101,
|
||||
VLESS_WS = 102,
|
||||
VLESS_H2 = 103,
|
||||
VLESS_KCP = 104,
|
||||
VLESS_QUIC = 105,
|
||||
VLESS_gRPC = 110,
|
||||
|
||||
// VMESS 201开头
|
||||
VMESS_TCP = 201,
|
||||
VMESS_WS = 202,
|
||||
VMESS_H2 = 203,
|
||||
VMESS_KCP = 204,
|
||||
VMESS_QUIC = 205,
|
||||
|
||||
// Trojan 301开头
|
||||
Trojan_TCP = 301,
|
||||
Trojan_WS = 302,
|
||||
|
||||
// SS
|
||||
ShadowsocksAEAD = 401
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public class TrojanGoSettings : IProjectSettings
|
||||
{
|
||||
public TrojanGoSettings()
|
||||
{
|
||||
WithTLS = true;
|
||||
Port = 443;
|
||||
WebSocketPath = "/ws";
|
||||
Password = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
public List<int> FreePorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<int> { 80, 443, Port }.Distinct().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public ProjectType Type { get; set; } = ProjectType.TrojanGo;
|
||||
|
||||
/// <summary>
|
||||
/// 是否安装TLS证书
|
||||
/// </summary>
|
||||
public bool WithTLS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
public string Domain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 伪装域名
|
||||
/// </summary>
|
||||
public string MaskDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启WebSocket
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool EnableWebSocket
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrEmpty(WebSocketPath);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// websocket路径
|
||||
/// </summary>
|
||||
public string WebSocketPath { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public string Email
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Domain))
|
||||
{
|
||||
var arr = Domain.Split('.');
|
||||
if (arr.Length == 3)
|
||||
{
|
||||
return $"{arr[0]}@{arr[1]}.{arr[2]}";
|
||||
}
|
||||
}
|
||||
|
||||
var prefix = Password.Length > 7 ? Password.Substring(0, 7) : Password;
|
||||
return $"{prefix}@gmail.com";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,187 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using ProxySuper.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class V2raySettings : IProjectSettings
|
||||
{
|
||||
public static List<string> DisguiseTypes = new List<string> {
|
||||
"none",
|
||||
"srtp",
|
||||
"utp",
|
||||
"wechat-video",
|
||||
"dtls",
|
||||
"wireguard",
|
||||
};
|
||||
|
||||
public V2raySettings()
|
||||
{
|
||||
WithTLS = true;
|
||||
|
||||
var guid = Guid.NewGuid().ToString();
|
||||
Port = 443;
|
||||
VLESS_KCP_Port = 2001;
|
||||
VLESS_QUIC_Port = 2002;
|
||||
VLESS_gRPC_Port = 2003;
|
||||
|
||||
VMESS_KCP_Port = 3001;
|
||||
VMESS_QUIC_Port = 3002;
|
||||
ShadowSocksPort = 4001;
|
||||
|
||||
UUID = guid;
|
||||
Types = new List<RayType>();
|
||||
|
||||
VLESS_WS_Path = "/" + Utils.RandomString(6);
|
||||
VLESS_KCP_Type = "none";
|
||||
VLESS_KCP_Seed = guid;
|
||||
VLESS_QUIC_Key = "";
|
||||
VLESS_QUIC_Type = "none";
|
||||
VLESS_QUIC_Security = "none";
|
||||
VLESS_QUIC_Type = "none";
|
||||
VLESS_gRPC_ServiceName = Utils.RandomString(7);
|
||||
|
||||
VMESS_WS_Path = "/" + Utils.RandomString(8);
|
||||
VMESS_TCP_Path = "/" + Utils.RandomString(9);
|
||||
VMESS_KCP_Seed = guid;
|
||||
VMESS_QUIC_Key = "";
|
||||
VMESS_KCP_Type = "none";
|
||||
VMESS_QUIC_Security = "none";
|
||||
VMESS_QUIC_Type = "none";
|
||||
|
||||
TrojanPassword = guid;
|
||||
|
||||
ShadowSocksPassword = guid;
|
||||
ShadowSocksMethod = "aes-128-gcm";
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsIPAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
return IPAddress.TryParse(Domain, out _);
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public List<int> FreePorts
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new List<int>();
|
||||
list.Add(80);
|
||||
list.Add(Port);
|
||||
|
||||
if (Types.Contains(RayType.VLESS_KCP))
|
||||
{
|
||||
list.Add(VLESS_KCP_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.VLESS_QUIC))
|
||||
{
|
||||
list.Add(VLESS_QUIC_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.VMESS_KCP))
|
||||
{
|
||||
list.Add(VMESS_KCP_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.VMESS_QUIC))
|
||||
{
|
||||
list.Add(VMESS_QUIC_Port);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.ShadowsocksAEAD))
|
||||
{
|
||||
list.Add(ShadowSocksPort);
|
||||
}
|
||||
|
||||
if (Types.Contains(RayType.VLESS_gRPC))
|
||||
{
|
||||
list.Add(VLESS_gRPC_Port);
|
||||
}
|
||||
|
||||
return list.Distinct().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否安装证书,
|
||||
/// 上传自有证书时选False,则不会自动安装证书。
|
||||
/// </summary>
|
||||
public bool WithTLS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
public string Domain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UUID
|
||||
/// </summary>
|
||||
public string UUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多用户
|
||||
/// </summary>
|
||||
public List<string> MulitUUID { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 伪装域名
|
||||
/// </summary>
|
||||
public string MaskDomain { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Email
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Domain))
|
||||
{
|
||||
var arr = Domain.Split('.');
|
||||
if (arr.Length == 3)
|
||||
{
|
||||
return $"{arr[0]}@{arr[1]}.{arr[2]}";
|
||||
}
|
||||
}
|
||||
|
||||
return $"{UUID.Substring(2, 6)}@gmail.com";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安装类型
|
||||
/// </summary>
|
||||
public List<RayType> Types { get; set; } = new List<RayType>();
|
||||
|
||||
/// <summary>
|
||||
/// 根据xray类型获取路径
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public string GetPath(RayType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case RayType.VLESS_WS:
|
||||
return VLESS_WS_Path;
|
||||
case RayType.VMESS_TCP:
|
||||
return VMESS_TCP_Path;
|
||||
case RayType.VMESS_WS:
|
||||
return VMESS_WS_Path;
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
using ProxySuper.Core.Services;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class V2raySettings
|
||||
{
|
||||
/// <summary>
|
||||
/// ss password
|
||||
/// </summary>
|
||||
public string ShadowSocksPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ss method
|
||||
/// </summary>
|
||||
public string ShadowSocksMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ss port
|
||||
/// </summary>
|
||||
public int ShadowSocksPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// share link
|
||||
/// </summary>
|
||||
public string ShadowSocksShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.ShadowsocksAEAD, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
using ProxySuper.Core.Services;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class V2raySettings
|
||||
{
|
||||
public string TrojanPassword { get; set; }
|
||||
|
||||
public string Trojan_TCP_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.Trojan_TCP, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,115 +0,0 @@
|
|||
using ProxySuper.Core.Services;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Documents;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public partial class V2raySettings
|
||||
{
|
||||
/// <summary>
|
||||
/// vless tcp shareLink
|
||||
/// </summary>
|
||||
public string VLESS_TCP_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.VLESS_TCP, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// websocket path
|
||||
/// </summary>
|
||||
public string VLESS_WS_Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// VLESS WS ShareLink
|
||||
/// </summary>
|
||||
public string VLESS_WS_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.VLESS_WS, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// kcp seed
|
||||
/// </summary>
|
||||
public string VLESS_KCP_Seed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// kcp type
|
||||
/// </summary>
|
||||
public string VLESS_KCP_Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// kcp port
|
||||
/// </summary>
|
||||
public int VLESS_KCP_Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// VLESS KCP ShareLink
|
||||
/// </summary>
|
||||
public string VLESS_KCP_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.VLESS_KCP, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// vless quic security
|
||||
/// </summary>
|
||||
public string VLESS_QUIC_Security { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless quic type
|
||||
/// </summary>
|
||||
public string VLESS_QUIC_Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless quic port
|
||||
/// </summary>
|
||||
public int VLESS_QUIC_Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless quic key
|
||||
/// </summary>
|
||||
public string VLESS_QUIC_Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless quic ShareLink
|
||||
/// </summary>
|
||||
public string VLESS_QUIC_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.VLESS_QUIC, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// grpc port
|
||||
/// </summary>
|
||||
public int VLESS_gRPC_Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// grpc service name
|
||||
/// </summary>
|
||||
public string VLESS_gRPC_ServiceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless grpc share link
|
||||
/// </summary>
|
||||
public string VLESS_gRPC_ShareLink
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShareLink.Build(RayType.VLESS_gRPC, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue