コード例 #1
0
        // Token: 0x0600056C RID: 1388 RVA: 0x00012E8C File Offset: 0x0001108C
        public static void HandleCommand(Client client, IPacket packet)
        {
            Type type = packet.GetType();

            if (type == typeof(ReverseProxyConnect))
            {
                client.ConnectReverseProxy((ReverseProxyConnect)packet);
                return;
            }
            if (type == typeof(ReverseProxyData))
            {
                ReverseProxyData   reverseProxyData           = (ReverseProxyData)packet;
                ReverseProxyClient reverseProxyByConnectionId = client.GetReverseProxyByConnectionId(reverseProxyData.ConnectionId);
                if (reverseProxyByConnectionId != null)
                {
                    reverseProxyByConnectionId.SendToTargetServer(reverseProxyData.Data);
                    return;
                }
            }
            else if (type == typeof(ReverseProxyDisconnect))
            {
                ReverseProxyDisconnect reverseProxyDisconnect      = (ReverseProxyDisconnect)packet;
                ReverseProxyClient     reverseProxyByConnectionId2 = client.GetReverseProxyByConnectionId(reverseProxyDisconnect.ConnectionId);
                if (reverseProxyByConnectionId2 != null)
                {
                    reverseProxyByConnectionId2.Disconnect();
                }
            }
        }
コード例 #2
0
        public static void HandleCommand(Client client, IPacket packet)
        {
            var type = packet.GetType();

            if (type == typeof(ReverseProxyConnect))
            {
                client.ConnectReverseProxy((ReverseProxyConnect)packet);
            }
            else if (type == typeof(ReverseProxyData))
            {
                ReverseProxyData   dataCommand = (ReverseProxyData)packet;
                ReverseProxyClient proxyClient = client.GetReverseProxyByConnectionId(dataCommand.ConnectionId);

                if (proxyClient != null)
                {
                    proxyClient.SendToTargetServer(dataCommand.Data);
                }
            }
            else if (type == typeof(ReverseProxyDisconnect))
            {
                ReverseProxyDisconnect disconnectCommand = (ReverseProxyDisconnect)packet;
                ReverseProxyClient     socksClient       = client.GetReverseProxyByConnectionId(disconnectCommand.ConnectionId);

                if (socksClient != null)
                {
                    socksClient.Disconnect();
                }
            }
        }