Ejemplo n.º 1
0
        internal void CallonUpdateConnection(ReverseProxyClient proxyClient)
        {
            //remove a client that has been disconnected
            try
            {
                if (!proxyClient.IsConnected)
                {
                    lock (_clients)
                    {
                        for (int i = 0; i < _clients.Count; i++)
                        {
                            if (_clients[i].ConnectionId == proxyClient.ConnectionId)
                            {
                                _clients.RemoveAt(i);
                                break;
                            }
                        }
                    }
                }
            }
            catch
            {
            }

            try
            {
                if (OnUpdateConnection != null)
                    OnUpdateConnection(proxyClient);
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
 internal void CallonConnectionEstablished(ReverseProxyClient proxyClient)
 {
     try
     {
         if (OnConnectionEstablished != null)
             OnConnectionEstablished(proxyClient);
     }
     catch
     {
     }
 }
Ejemplo n.º 3
0
        public static void HandleCommand(Client client, IPacket packet)
        {
            var type = packet.GetType();

            if (type == typeof(ReverseProxyConnectResponse))
            {
                ReverseProxyConnectResponse response = (ReverseProxyConnectResponse)packet;
                if (client.Value.ProxyServer != null)
                {
                    ReverseProxyClient socksClient =
                        client.Value.ProxyServer.GetClientByConnectionId(response.ConnectionId);
                    if (socksClient != null)
                    {
                        socksClient.CommandResponse(response);
                    }
                }
            }
            else if (type == typeof(ReverseProxyData))
            {
                ReverseProxyData   dataCommand = (ReverseProxyData)packet;
                ReverseProxyClient socksClient =
                    client.Value.ProxyServer.GetClientByConnectionId(dataCommand.ConnectionId);

                if (socksClient != null)
                {
                    socksClient.SendToClient(dataCommand.Data);
                }
            }
            else if (type == typeof(ReverseProxyDisconnect))
            {
                ReverseProxyDisconnect disconnectCommand = (ReverseProxyDisconnect)packet;
                ReverseProxyClient     socksClient       =
                    client.Value.ProxyServer.GetClientByConnectionId(disconnectCommand.ConnectionId);

                if (socksClient != null)
                {
                    socksClient.Disconnect();
                }
            }
        }
Ejemplo n.º 4
0
        internal void CallonUpdateConnection(ReverseProxyClient proxyClient)
        {
            //remove a client that has been disconnected
            try
            {
                if (!proxyClient.IsConnected)
                {
                    lock (_clients)
                    {
                        for (int i = 0; i < _clients.Count; i++)
                        {
                            if (_clients[i].ConnectionId == proxyClient.ConnectionId)
                            {
                                _clients.RemoveAt(i);
                                break;
                            }
                        }
                    }
                }
            }
            catch
            {
            }

            try
            {
                if (OnUpdateConnection != null)
                    OnUpdateConnection(proxyClient);
            }
            catch
            {
            }
        }
Ejemplo n.º 5
0
 internal void CallonConnectionEstablished(ReverseProxyClient proxyClient)
 {
     try
     {
         if (OnConnectionEstablished != null)
             OnConnectionEstablished(proxyClient);
     }
     catch
     {
     }
 }
Ejemplo n.º 6
0
        void socksServer_onConnectionEstablished(ReverseProxyClient proxyClient)
        {

        }
Ejemplo n.º 7
0
        void socksServer_onUpdateConnection(ReverseProxyClient proxyClient)
        {

        }