private void RebuildClient() { if (radioDefault.Checked) { _client = new DefaultProxyClientFactory(); } else if (radioDirect.Checked) { _client = new IpProxyClientFactory(); } else if (radioProxy.Checked) { TcpProxyClientFactory factory; if (radioHttp.Checked) { factory = new HttpProxyClientFactory(); } else { SocksProxyClientFactory f = new SocksProxyClientFactory(); f.Version4 = radioSocksv4.Checked; f.SendHostname = checkBoxSendHostName.Checked; factory = f; } factory.Hostname = textBoxHost.Text; factory.Port = (int)numericUpDownPort.Value; factory.IPv6 = checkBoxIpv6.Checked; _client = factory; } else if (radioSystem.Checked) { _client = new SystemProxyClientFactory(); } else if (radioButtonPac.Checked) { _client = new ScriptProxyClientFactory() { Script = _currentScript }; } }
public ValuesController(HttpProxyClientFactory httpClientFactory) { this.httpClientFactory = httpClientFactory; }