Add HTTP proxy support in forward proxy (#745)

* Add HTTP proxy support in forward proxy

Signed-off-by: noisyfox <timemanager.rick@gmail.com>

* Typo

* Throw exception if forward proxy not supported.
This commit is contained in:
Noisyfox
2016-09-24 23:37:24 -05:00
committed by Syrone Wong
parent 156b3acd9b
commit 35fc73b58b
13 changed files with 532 additions and 23 deletions
@@ -63,6 +63,11 @@ namespace Shadowsocks.Model
config.proxy = new ProxyConfig();
if (config.hotkey == null)
config.hotkey = new HotkeyConfig();
if (config.proxy.proxyType < ProxyConfig.PROXY_SOCKS5 || config.proxy.proxyType > ProxyConfig.PROXY_HTTP)
{
config.proxy.proxyType = ProxyConfig.PROXY_SOCKS5;
}
return config;
}
catch (Exception e)
+6 -4
View File
@@ -1,20 +1,22 @@
using Shadowsocks.View;
using System;
using System.Drawing;
using System.Windows.Forms;
using System;
namespace Shadowsocks.Model
{
[Serializable]
public class ProxyConfig
{
public const int PROXY_SOCKS5 = 0;
public const int PROXY_HTTP = 1;
public bool useProxy;
public int proxyType;
public string proxyServer;
public int proxyPort;
public ProxyConfig()
{
useProxy = false;
proxyType = PROXY_SOCKS5;
proxyServer = "";
proxyPort = 0;
}