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

Commit

Permalink
support socks proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenmrev committed Dec 23, 2016
1 parent 069d8b5 commit 04020f5
Show file tree
Hide file tree
Showing 8 changed files with 433 additions and 110 deletions.
3 changes: 3 additions & 0 deletions V2RayW/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
<setting name="proxyMode" serializeAs="String">
<value>0</value>
</setting>
<setting name="inProtocol" serializeAs="String">
<value>0</value>
</setting>
</V2RayW.Properties.Settings>
</userSettings>
</configuration>
22 changes: 22 additions & 0 deletions V2RayW/ConfigForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion V2RayW/ConfigForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ private void buttonSave_Click(object sender, EventArgs e)
Program.selectedServerIndex = ConfigForm.profiles.Count > 0 ? listBoxServers.SelectedIndex : -1;

// save to file
Properties.Settings.Default.localPort = Program.strToInt(textBoxLocalPort.Text, 8080);
Properties.Settings.Default.inProtocol = comboBoxInP.SelectedIndex; // 0:socks, 1:http
Properties.Settings.Default.localPort = Program.strToInt(textBoxLocalPort.Text, 1080);
Properties.Settings.Default.udpSupport = checkBoxUDP.Checked;
Properties.Settings.Default.dns = textBoxDNS.Text != "" ? textBoxDNS.Text : "localhost";
var profileArray = Program.profiles.Select(p => Program.profileToStr(p));
Expand Down Expand Up @@ -75,6 +76,7 @@ private void ConfigForm_Load(object sender, EventArgs e)
}

Properties.Settings.Default.Upgrade();
comboBoxInP.SelectedIndex = Properties.Settings.Default.inProtocol;
textBoxLocalPort.Text = Properties.Settings.Default.localPort.ToString();
checkBoxUDP.Checked = Properties.Settings.Default.udpSupport;
textBoxDNS.Text = Properties.Settings.Default.dns;
Expand Down Expand Up @@ -220,5 +222,10 @@ private void comboBoxNetwork_SelectedIndexChanged(object sender, EventArgs e)
profiles[selectedServerIndex].network = comboBoxNetwork.SelectedIndex;
}
}

private void comboBoxInP_SelectedIndexChanged(object sender, EventArgs e)
{
checkBoxUDP.Visible = comboBoxInP.SelectedIndex == 0;
}
}
}
Loading

0 comments on commit 04020f5

Please sign in to comment.