private bool StartProxy() { try { HttpProxy.Startup(_config.Proxy.Listen); } catch (SocketException e) { if (e.SocketErrorCode != SocketError.AddressAlreadyInUse && e.SocketErrorCode != SocketError.AccessDenied) { throw; } if (WarnConflictPortNumber(_config.Proxy.Listen, _config.Proxy.Auto) == DialogResult.No || !_config.Proxy.Auto) { RestoreSystemProxy(); return(false); } HttpProxy.Startup(0); _config.Proxy.Listen = HttpProxy.LocalPort; } return(true); }
public static void Startup(int port) { LocalPort = port; _httpProxy = new HttpProxy(); _httpProxy.Start(); }
private void ShutdownProxy() { HttpProxy.Shutdown(); }