void IniciarTor() { if (torController != null) { torController.Dispose(); } torController = new GusTorController(); if (torController.Start(8192, 8193)) { if (torController.Autheticate()) { direccionServicio = torController.RegisterHiddenService("servicio", 80, IPAddress.Parse("127.0.0.1"), 8190); if (direccionServicio == null) { MessageBox.Show(Traducir("No se pudo registrar el servicio de TOR, no se podrá acceder a tu servidor.")); } else { bridge = new GusMainServer(8191, false); if (!bridge.Start()) { MessageBox.Show(Traducir("Error creando puente HTTP")); torController.Dispose(); torController = null; bridge = null; return; } bridge.AddPath(bridgePath); servicioTor.Text = direccionServicio; } button1.Enabled = false; button2.Enabled = true; button6.Enabled = true; } else { MessageBox.Show(Traducir("Fallo de autenticación de TOR!")); torController.Dispose(); torController = null; } } else { MessageBox.Show(Traducir("No se pudo iniciar TOR, verifica tu conexión a Internet.")); torController.Dispose(); torController = null; } }
private void DetenerTor() { if (torController != null) { torController.Dispose(); torController = null; bridge.RemovePath(bridgePath); bridge.Stop(); bridge = null; } button1.Enabled = true; button2.Enabled = false; button6.Enabled = false; }