Skip to content

Commit

Permalink
1.0.0.2
Browse files Browse the repository at this point in the history
增加mux选项
  • Loading branch information
Shinlor committed May 8, 2018
1 parent f68001d commit bc62a9e
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 20 deletions.
14 changes: 13 additions & 1 deletion V2RayS.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
VisualStudioVersion = 15.0.27130.2003
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "V2RayS", "V2RayS\V2RayS.csproj", "{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Debug|x64.ActiveCfg = Debug|x64
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Debug|x64.Build.0 = Debug|x64
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Debug|x86.ActiveCfg = Debug|x86
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Debug|x86.Build.0 = Debug|x86
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Release|Any CPU.Build.0 = Release|Any CPU
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Release|x64.ActiveCfg = Release|x64
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Release|x64.Build.0 = Release|x64
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Release|x86.ActiveCfg = Release|x86
{8F0C0712-D429-4C1C-873C-BDC8ABF0454C}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
11 changes: 11 additions & 0 deletions V2RayS/ConfigV2RayJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace V2RayS
{
Expand All @@ -21,13 +22,18 @@ public void ReadFile(string FilePath)
public void SaveFile()
{
string js = Config.ToString();
//MessageBox.Show(js);
System.IO.File.WriteAllText(FILE_PATH, js);
return;
}
public string Readloglevel()
{
return Config.log.loglevel;
}
public string Readmux()
{
return Config.outbound.mux.enabled;
}
public string ReadPort()
{
return Config.inbound.port;
Expand Down Expand Up @@ -61,6 +67,11 @@ public void Setloglevel(string loglevel)
Config.log.loglevel = loglevel;
SaveFile();
}
public void SetMux(bool mux)
{
Config.outbound.mux.enabled = mux;
SaveFile();
}
public void SetPort(int port)
{
Config.inbound.port = port;
Expand Down
5 changes: 3 additions & 2 deletions V2RayS/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:V2RayS"
mc:Ignorable="d"
Title="V2RayS" Height="295" Width="650" MinWidth="650" MinHeight="295" ResizeMode="CanMinimize" Visibility="Hidden">
Title="V2RayS" Height="295" Width="650" MinWidth="650" MinHeight="295" ResizeMode="CanMinimize" Visibility="Visible">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80*"/>
Expand All @@ -30,7 +30,7 @@
<Label Content="Security" HorizontalAlignment="Left" Margin="122,140,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.232,-0.864" Width="70" Height="23" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBox x:Name="ServerIPTextBox" HorizontalAlignment="Left" Height="23" Margin="192,1,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="200" VerticalContentAlignment="Center"/>
<TextBox x:Name="ServerPortTextBox" HorizontalAlignment="Left" Height="23" Margin="192,36,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="200" VerticalContentAlignment="Center"/>
<TextBox x:Name="ServerUserIDTextBox" HorizontalAlignment="Left" Height="23" Margin="192,70,0,0" VerticalAlignment="Top" Width="200" VerticalContentAlignment="Center" MaxLines="1"/>
<TextBox x:Name="ServerUserIDTextBox" HorizontalAlignment="Left" Height="23" Margin="192,70,0,0" VerticalAlignment="Top" Width="200" VerticalContentAlignment="Center" MaxLines="1" TextChanged="ServerUserIDTextBox_TextChanged"/>
<TextBox x:Name="ServerAlterIDTextBox" HorizontalAlignment="Left" Height="23" Margin="192,105,0,0" TextWrapping="WrapWithOverflow" VerticalAlignment="Top" Width="200" VerticalContentAlignment="Center" MaxLines="1"/>
<Button x:Name="UseToV2rayButton" Content="应用到V2Ray" HorizontalAlignment="Left" Margin="272,181,0,0" VerticalAlignment="Top" Width="120" Height="25" Click="UseToV2rayButton_Click"/>
<ComboBox x:Name="ServerSecurityComboBox" HorizontalAlignment="Left" Margin="192,140,0,0" VerticalAlignment="Top" Width="200" RenderTransformOrigin="0.394,-0.281" Height="23">
Expand Down Expand Up @@ -58,5 +58,6 @@
<ComboBoxItem Content="error" HorizontalAlignment="Left" Width="99"/>
<ComboBoxItem Content="none" HorizontalAlignment="Left" Width="99"/>
</ComboBox>
<CheckBox x:Name="MuxCheckBox" Content="开启Mux" Grid.Column="1" HorizontalAlignment="Left" Margin="212,188,0,0" VerticalAlignment="Top"/>
</Grid>
</Window>
49 changes: 38 additions & 11 deletions V2RayS/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public partial class MainWindow : Window
V2RaySconfig XMLConfig = new V2RaySconfig();
ConfigV2RayJson V2rayJson = new ConfigV2RayJson();
AutoStart AutoStartReg = new AutoStart();
string IP, Port, UserID, AlterID, Security;
string IP, Port, UserID, AlterID, Security,Mux;
string ServerIP, ServerPort,ServerUserID,ServerAlterID,ServerSecurity;//用于存储当前使用的Vrayserver的IP及Port等
int CurrentUsedServerIndex=-1;//用于存储当前使用的server在listBox中的index
string ProxyIP = @"127.0.0.1";
Expand Down Expand Up @@ -100,8 +100,20 @@ public void INIT()//初始化
ServerPort = V2rayJson.ReadServerPort();
ServerUserID = V2rayJson.ReadServerUserID();
ServerSecurity = V2rayJson.ReadServerSecurity();
ServerAlterID = V2rayJson.ReadServerAlterID();
ServerAlterID = V2rayJson.ReadServerAlterID();
Mux = V2rayJson.Readmux();
PacPort = XMLConfig.ReadPort();//给Port赋值为配置文件中的端口

//V2ray是否开启mux
if (Mux == "True")
{
MuxCheckBox.IsChecked = true;
}
else if (Mux == "False")
{
MuxCheckBox.IsChecked = false;
}

//配置文件中是否启用代理
if (XMLConfig.ReadEnable() == "true")
{
Expand Down Expand Up @@ -217,7 +229,7 @@ private void Writelog(string Data)//根据委托的设置,自动刷新日志
public void V2RaySNotify()
{
//定义notifyicon
this.notifyIcon.Text = "V2RayS V1.0.0.1";
this.notifyIcon.Text = "V2RayS V1.0.0.2";
//this.notifyIcon.Icon = V2RayS.Properties.Resources.V2RayS;
this.notifyIcon.Visible = true;
this.notifyIcon.ContextMenuStrip = this.V2rayMenuStrip;
Expand Down Expand Up @@ -404,14 +416,8 @@ public void Reload_Click(object sender, EventArgs e)//重载V2ray的process
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
V2rayJson.Setloglevel(ComboBoxLogLevel.Text);

ProxyPort = this.V2RayListenPortTextBox.Text;//更新V2ray监听的端口
V2rayJson.SetPort(int.Parse(ProxyPort));//更新V2ray监听的端口入配置文件

Logwindow.V2RayLog.Text = "Reloaded.." + "\r";
this.v2Ray.ReloadV2ray();
//autostart配置
if (AutoStartCheckBox.IsChecked==true)
if (AutoStartCheckBox.IsChecked == true)
{
AutoStartReg.SetStart(true, "V2RayS", FILE_FULL_PATH);
XMLConfig.WriteAutoStart("true");
Expand All @@ -420,7 +426,24 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
{
AutoStartReg.SetStart(false, "V2RayS", FILE_FULL_PATH);
XMLConfig.WriteAutoStart("false");
}
}

//mux配置
if (MuxCheckBox.IsChecked == true)
{
V2rayJson.SetMux(true);
}
else
{
V2rayJson.SetMux(false);
}

ProxyPort = this.V2RayListenPortTextBox.Text;//更新V2ray监听的端口
V2rayJson.SetPort(int.Parse(ProxyPort));//更新V2ray监听的端口入配置文件

Logwindow.V2RayLog.Text = "Reloaded.." + "\r";
this.v2Ray.ReloadV2ray();

}

private void ServerListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
Expand Down Expand Up @@ -459,6 +482,10 @@ private void ServerListBox_SelectionChanged(object sender, SelectionChangedEvent

}

private void ServerUserIDTextBox_TextChanged(object sender, TextChangedEventArgs e)
{

}
private void UseToV2rayButton_Click(object sender, RoutedEventArgs e)
{
V2rayJson.SetServerAddress(this.ServerIPTextBox.Text);
Expand Down
4 changes: 2 additions & 2 deletions V2RayS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: NeutralResourcesLanguage("zh-CN")]

44 changes: 40 additions & 4 deletions V2RayS/V2RayS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.1</ApplicationVersion>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>1.0.0.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down Expand Up @@ -67,6 +67,42 @@
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -155,9 +191,9 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<BootstrapperPackage Include=".NETFramework,Version=v4.6">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 和 x64%29</ProductName>
<ProductName>Microsoft .NET Framework 4.6 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
Expand Down

0 comments on commit bc62a9e

Please sign in to comment.