diff --git a/Quasar.Server/Messages/ReverseProxyHandler.cs b/Quasar.Server/Messages/ReverseProxyHandler.cs index 16f91e25..ef5b8b59 100644 --- a/Quasar.Server/Messages/ReverseProxyHandler.cs +++ b/Quasar.Server/Messages/ReverseProxyHandler.cs @@ -17,7 +17,7 @@ public class ReverseProxyHandler : MessageProcessorBase /// /// The reverse proxy server to accept & serve SOCKS5 connections. /// - private ReverseProxyServer _socksServer; + private readonly ReverseProxyServer _socksServer; /// /// Initializes a new instance of the class using the given clients. @@ -25,6 +25,7 @@ public class ReverseProxyHandler : MessageProcessorBase /// The associated clients. public ReverseProxyHandler(Client[] clients) : base(true) { + _socksServer = new ReverseProxyServer(); _clients = clients; } @@ -59,7 +60,6 @@ public override void Execute(ISender sender, IMessage message) /// The port to listen on. public void StartReverseProxyServer(ushort port) { - _socksServer = new ReverseProxyServer(); _socksServer.OnConnectionEstablished += socksServer_onConnectionEstablished; _socksServer.OnUpdateConnection += socksServer_onUpdateConnection; _socksServer.StartServer(_clients, "0.0.0.0", port);