Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
move transport settings into outbound settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenmrev committed Jan 8, 2017
1 parent 5a6e06b commit 25b4b45
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion V2RayW/ConfigForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private void ConfigForm_Load(object sender, EventArgs e)
profiles.Add(p.DeepCopy());
}

Properties.Settings.Default.Upgrade();
//Properties.Settings.Default.Upgrade();
comboBoxInP.SelectedIndex = Properties.Settings.Default.inProtocol;
textBoxLocalPort.Text = Properties.Settings.Default.localPort.ToString();
checkBoxUDP.Checked = Properties.Settings.Default.udpSupport;
Expand Down
2 changes: 1 addition & 1 deletion V2RayW/FormTransSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void buttonTSSave_Click(object sender, EventArgs e)

private void FormTransSetting_Load(object sender, EventArgs e)
{
Properties.Settings.Default.Upgrade();
//Properties.Settings.Default.Upgrade();
string transportSettingsStr = Properties.Settings.Default.transportSettings;
dynamic transportSettings = JObject.Parse(transportSettingsStr);
textBoxKcpMtu.Text = transportSettings.kcpSettings.mtu;
Expand Down
10 changes: 7 additions & 3 deletions V2RayW/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static int proxyMode
}
}
public static MainForm mainForm;
const string v2rayVersion = "v2.13.1";
const string v2rayVersion = "v2.13.2";
static BackgroundWorker v2rayCoreWorker = new BackgroundWorker();
public static AutoResetEvent _resetEvent = new AutoResetEvent(false);
public static bool finalAction = false;
Expand Down Expand Up @@ -83,7 +83,7 @@ static void Main()
}
case 1:
{
DialogResult res = MessageBox.Show(String.Format("Unknown version of v2ray core.\n{0} is suggested. Do you want to continue to use existing core?", Program.v2rayVersion), "Unknown v2ray.exe!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
DialogResult res = MessageBox.Show(String.Format("Unknown version of v2ray core detected, which may not be compatible with V2RayW.\n{0} is suggested. Do you want to continue to use the existing core?", Program.v2rayVersion), "Unknown v2ray.exe!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
if (res == DialogResult.OK)
{
break;
Expand Down Expand Up @@ -304,7 +304,7 @@ public static bool generateConfigJson()
{
string templateStr = Encoding.UTF8.GetString(proxyMode == 0 ? Properties.Resources.config_rules : Properties.Resources.config_simple);
dynamic json = JObject.Parse(templateStr);
json.transport = JObject.Parse(Properties.Settings.Default.transportSettings);
//json.transport = JObject.Parse(Properties.Settings.Default.transportSettings);
json.inbound.port = Properties.Settings.Default.localPort;
json.inbound.protocol = Properties.Settings.Default.inProtocol == 0 ? "socks" : "http";
if (Properties.Settings.Default.inProtocol == 0)
Expand All @@ -327,6 +327,10 @@ public static bool generateConfigJson()
json.outbound.settings.vnext[0].users[0].alterId = profiles[selectedServerIndex].alterId;
json.outbound.settings.vnext[0].users[0].security = (new string[] { "aes-128-cfb", "aes-128-gcm", "chacha20-poly1305" })[profiles[selectedServerIndex].security % 3];
json.outbound.streamSettings.network = (new string[]{ "tcp", "kcp", "ws" })[profiles[selectedServerIndex].network % 3];
var ts = JObject.Parse(Properties.Settings.Default.transportSettings);
json.outbound.streamSettings.tcpSettings = ts["tcpSettings"];
json.outbound.streamSettings.kcpSettings = ts["kcpSettings"];
json.outbound.streamSettings.wsSettings = ts["wsSettings"];
var dnsArray = Properties.Settings.Default.dns.Split(',');
json.dns = JObject.Parse(dnsArray.Count() > 0 ? JsonConvert.SerializeObject( new { servers = dnsArray }) : "{\"servers\":[\"localhost\"]}");
try
Expand Down
4 changes: 2 additions & 2 deletions V2RayW/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.5.0")]
[assembly: AssemblyFileVersion("0.0.5.0")]
[assembly: AssemblyVersion("0.0.6.0")]
[assembly: AssemblyFileVersion("0.0.6.0")]
[assembly: NeutralResourcesLanguage("")]

0 comments on commit 25b4b45

Please sign in to comment.