static void Main(string[] args) { Socks5Server x = new Socks5Server(IPAddress.Any, 10084); x.Start(); PluginLoader.ChangePluginStatus(false, typeof(DataHandlerExample)); //enable plugin. foreach (object pl in PluginLoader.GetPlugins) { //if (pl.GetType() == typeof(LoginHandlerExample)) //{ // //enable it. // PluginLoader.ChangePluginStatus(true, pl.GetType()); // Console.WriteLine("Enabled {0}.", pl.GetType().ToString()); //} } //Start showing network stats. Socks5Client p = new Socks5Client("localhost", 10084, "127.0.0.1", 10084, "yolo", "swag"); p.OnConnected += p_OnConnected; p.ConnectAsync(); //while (true) //{ // // Console.Clear(); // Console.Write("Total Clients: \t{0}\nTotal Recvd: \t{1:0.00##}MB\nTotal Sent: \t{2:0.00##}MB\n", x.Stats.TotalClients, ((x.Stats.NetworkReceived / 1024f) / 1024f), ((x.Stats.NetworkSent / 1024f) / 1024f)); // Console.Write("Receiving/sec: \t{0}\nSending/sec: \t{1}", x.Stats.BytesReceivedPerSec, x.Stats.BytesSentPerSec); // Thread.Sleep(1000); //} }
private void btnResetSrv_Click(object sender, RoutedEventArgs e) { var thread = new Thread(() => { if (x != null) { DoLog("SERVER STOPPING!"); try { x.Stop(); } catch (Exception ex) { DoLog(ex.Message); } x = null; DoLog("\tSERVER STOPPED!"); } DoLog("SERVER RESTARTING!"); x = new Socks5Server(IPAddress.Any, port); x.Start(); PluginLoader.ChangePluginStatus(false, typeof(DataHandlerExample)); //enable plugin. foreach (object pl in PluginLoader.GetPlugins) { //if (pl.GetType() == typeof(LoginHandlerExample)) //{ // //enable it. // PluginLoader.ChangePluginStatus(true, pl.GetType()); // Console.WriteLine("Enabled {0}.", pl.GetType().ToString()); //} } //Start showing network stats. Socks5Client.Socks5Client p = new Socks5Client.Socks5Client("localhost", 80, "127.0.0.1", 80, "lemur", "bison"); p.OnConnected += p_OnConnected; p.ConnectAsync(); //while (true) //{ // // Console.Clear(); // Console.Write("Total Clients: \t{0}\nTotal Recvd: \t{1:0.00##}MB\nTotal Sent: \t{2:0.00##}MB\n", x.Stats.TotalClients, ((x.Stats.NetworkReceived / 1024f) / 1024f), ((x.Stats.NetworkSent / 1024f) / 1024f)); // Console.Write("Receiving/sec: \t{0}\nSending/sec: \t{1}", x.Stats.BytesReceivedPerSec, x.Stats.BytesSentPerSec); // Thread.Sleep(1000); //} DoLog("\tSERVER RESTARTED!"); }); thread.Start(); }
static void Main(string[] args) { Socks5Server x = new Socks5Server(IPAddress.Any, 1080); PluginLoader.ChangePluginStatus(false, typeof(Auth)); x.Start(); while (true) { Console.Clear(); Console.Write("Total Clients: \t{0}\nTotal Recvd: \t{1:0.00##}MB\nTotal Sent: \t{2:0.00##}MB\n", x.Stats.TotalClients, ((x.Stats.NetworkReceived / 1024f) / 1024f), ((x.Stats.NetworkSent / 1024f) / 1024f)); Console.Write("Receiving/sec: \t{0}\nSending/sec: \t{1}", x.Stats.BytesReceivedPerSec, x.Stats.BytesSentPerSec); Thread.Sleep(1000); } }
public void Start(int port, string userName, string password) { x = new Socks5Server(IPAddress.Any, port); Auth.Initialize(userName, password); PluginLoader.ChangePluginStatus(true, typeof(Auth)); x.Start(); while (true) { //Console.Clear(); Console.Write("Total Clients: \t{0}\nTotal Recvd: \t{1:0.00##}MB\nTotal Sent: \t{2:0.00##}MB\n", x.Stats.TotalClients, ((x.Stats.NetworkReceived / 1024f) / 1024f), ((x.Stats.NetworkSent / 1024f) / 1024f)); Console.Write("Receiving/sec: \t{0}\nSending/sec: \t{1}", x.Stats.SBytesReceivedPerSec, x.Stats.SBytesSentPerSec); Thread.Sleep(TimeSpan.FromHours(1)); } }
static void Main(string[] args) { Socks5Server x = new Socks5Server(IPAddress.Any, 1080); PluginLoader.ChangePluginStatus(false, typeof(Auth)); x.Start(); Socks5Client m = new Socks5Client("localhost", 1080, "portquiz.net", 65532); m.OnConnected += M_OnConnected; m.OnDataReceived += M_OnDataReceived; m.ConnectAsync(); while (true) { //Console.Clear(); //Console.Write("Total Clients: \t{0}\nTotal Recvd: \t{1:0.00##}MB\nTotal Sent: \t{2:0.00##}MB\n", x.Stats.TotalClients, ((x.Stats.NetworkReceived / 1024f) / 1024f), ((x.Stats.NetworkSent / 1024f) / 1024f)); //Console.Write("Receiving/sec: \t{0}\nSending/sec: \t{1}", x.Stats.SBytesReceivedPerSec, x.Stats.SBytesSentPerSec); Thread.Sleep(1000); } }
public EnablePlugin() { PluginLoader.ChangePluginStatus(true, typeof(MyCustomPlugin)); }