Beispiel #1
0
        public NetProxy(NetProxyType type, string address, int port, NetworkCredential credential = null)
        {
            _type = type;

            switch (type)
            {
            case NetProxyType.Http:
                _httpProxy = new WebProxyEx(new Uri("http://" + address + ":" + port), false, new string[] { }, credential);
                break;

            case NetProxyType.Socks5:
                _socksProxy = new SocksClient(address, port, credential);
                break;

            default:
                throw new NotSupportedException("Proxy type not supported.");
            }
        }
Beispiel #2
0
 public NetProxy(WebProxyEx httpProxy)
 {
     _type      = NetProxyType.Http;
     _httpProxy = httpProxy;
 }