Ejemplo n.º 1
0
 def action_JAP(self, request):
     configuration = JAP_LOCAL.getConfiguration("./JAP.json", getDefaultConfiguration)
     
     encoder = JAP_LOCAL.JSONEncoder()
     data = encoder.encode(configuration)
     
     return data
Ejemplo n.º 2
0
 def action_JAP_REMOTE_WS_START(self, request):
     port = self.port_JAP_REMOTE_WS
     
     if port == None:
         configuration = JAP_LOCAL.getConfiguration("./JAP_REMOTE_WS.json", JAP_REMOTE_WS.getDefaultConfiguration)
         
         if configuration["REMOTE_PROXY_SERVER"]["TYPE"] == "HTTPS":
             factory = JAP_REMOTE_WS.WSInputProtocolFactory(configuration, "wss://" + str(configuration["REMOTE_PROXY_SERVER"]["ADDRESS"]) + ":" + str(configuration["REMOTE_PROXY_SERVER"]["PORT"]), debug = False)
             factory.protocol = JAP_REMOTE_WS.WSInputProtocol
             
             contextFactory = ssl.DefaultOpenSSLContextFactory(configuration["REMOTE_PROXY_SERVER"]["CERTIFICATE"]["KEY"]["FILE"], configuration["REMOTE_PROXY_SERVER"]["CERTIFICATE"]["FILE"])
             
             port = ssl.Port(configuration["REMOTE_PROXY_SERVER"]["PORT"], factory, contextFactory, 50, configuration["REMOTE_PROXY_SERVER"]["ADDRESS"], reactor)
             port.startListening()
             
             self.port_JAP_REMOTE_WS = port
         else:
             factory = JAP_REMOTE_WS.WSInputProtocolFactory(configuration, "ws://" + str(configuration["REMOTE_PROXY_SERVER"]["ADDRESS"]) + ":" + str(configuration["REMOTE_PROXY_SERVER"]["PORT"]), debug = False)
             factory.protocol = JAP_REMOTE_WS.WSInputProtocol
             
             port = tcp.Port(configuration["REMOTE_PROXY_SERVER"]["PORT"], factory, 50, configuration["REMOTE_PROXY_SERVER"]["ADDRESS"], reactor)
             port.startListening()
             
             self.port_JAP_REMOTE_WS = port
         
         return ""
Ejemplo n.º 3
0
Archivo: JAP.py Proyecto: web883/jap
    def action_JAP_REMOTE_WS(self, request):
        configuration = JAP_LOCAL.getConfiguration(
            "./JAP_REMOTE_WS.json", JAP_REMOTE_WS.getDefaultConfiguration)

        encoder = JAP_LOCAL.JSONEncoder()
        data = encoder.encode(configuration)

        return data
Ejemplo n.º 4
0
 def action_JAP_REMOTE_SSH_START(self, request):
     port = self.port_JAP_REMOTE_SSH
     
     if port == None:
         configuration = JAP_LOCAL.getConfiguration("./JAP_REMOTE_SSH.json", JAP_REMOTE_SSH.getDefaultConfiguration)
         
         factory = JAP_REMOTE_SSH.SSHFactory(configuration)
         
         port = tcp.Port(configuration["REMOTE_PROXY_SERVER"]["PORT"], factory, 50, configuration["REMOTE_PROXY_SERVER"]["ADDRESS"], reactor)
         port.startListening()
         
         self.port_JAP_REMOTE_SSH = port
         
         return ""
Ejemplo n.º 5
0
 def action_JAP_LOCAL_WS_START(self, request):
     port = self.port_JAP_LOCAL_WS
     
     if port == None:
         configuration = JAP_LOCAL.getConfiguration("./JAP_LOCAL_WS.json", JAP_LOCAL_WS.getDefaultConfiguration)
         
         factory = JAP_LOCAL_WS.WSInputProtocolFactory(configuration)
         factory.protocol = JAP_LOCAL_WS.WSInputProtocol
         
         port = tcp.Port(configuration["LOCAL_PROXY_SERVER"]["PORT"], factory, 50, configuration["LOCAL_PROXY_SERVER"]["ADDRESS"], reactor)
         port.startListening()
         
         self.port_JAP_LOCAL_WS = port
         
         return ""
Ejemplo n.º 6
0
Archivo: JAP.py Proyecto: web883/jap
    def action_JAP_REMOTE_WS_START(self, request):
        port = self.port_JAP_REMOTE_WS

        if port == None:
            configuration = JAP_LOCAL.getConfiguration(
                "./JAP_REMOTE_WS.json", JAP_REMOTE_WS.getDefaultConfiguration)

            if configuration["REMOTE_PROXY_SERVER"]["TYPE"] == "HTTPS":
                factory = JAP_REMOTE_WS.WSInputProtocolFactory(
                    configuration,
                    "wss://" +
                    str(configuration["REMOTE_PROXY_SERVER"]["ADDRESS"]) +
                    ":" + str(configuration["REMOTE_PROXY_SERVER"]["PORT"]),
                    debug=False)
                factory.protocol = JAP_REMOTE_WS.WSInputProtocol

                contextFactory = ssl.DefaultOpenSSLContextFactory(
                    configuration["REMOTE_PROXY_SERVER"]["CERTIFICATE"]["KEY"]
                    ["FILE"], configuration["REMOTE_PROXY_SERVER"]
                    ["CERTIFICATE"]["FILE"])

                port = ssl.Port(
                    configuration["REMOTE_PROXY_SERVER"]["PORT"], factory,
                    contextFactory, 50,
                    configuration["REMOTE_PROXY_SERVER"]["ADDRESS"], reactor)
                port.startListening()

                self.port_JAP_REMOTE_WS = port
            else:
                factory = JAP_REMOTE_WS.WSInputProtocolFactory(
                    configuration,
                    "ws://" +
                    str(configuration["REMOTE_PROXY_SERVER"]["ADDRESS"]) +
                    ":" + str(configuration["REMOTE_PROXY_SERVER"]["PORT"]),
                    debug=False)
                factory.protocol = JAP_REMOTE_WS.WSInputProtocol

                port = tcp.Port(
                    configuration["REMOTE_PROXY_SERVER"]["PORT"], factory, 50,
                    configuration["REMOTE_PROXY_SERVER"]["ADDRESS"], reactor)
                port.startListening()

                self.port_JAP_REMOTE_WS = port

            return ""
Ejemplo n.º 7
0
Archivo: JAP.py Proyecto: web883/jap
    def action_JAP_REMOTE_SSH_START(self, request):
        port = self.port_JAP_REMOTE_SSH

        if port == None:
            configuration = JAP_LOCAL.getConfiguration(
                "./JAP_REMOTE_SSH.json",
                JAP_REMOTE_SSH.getDefaultConfiguration)

            factory = JAP_REMOTE_SSH.SSHFactory(configuration)

            port = tcp.Port(configuration["REMOTE_PROXY_SERVER"]["PORT"],
                            factory, 50,
                            configuration["REMOTE_PROXY_SERVER"]["ADDRESS"],
                            reactor)
            port.startListening()

            self.port_JAP_REMOTE_SSH = port

            return ""
Ejemplo n.º 8
0
Archivo: JAP.py Proyecto: web883/jap
    def action_JAP_LOCAL_WS_START(self, request):
        port = self.port_JAP_LOCAL_WS

        if port == None:
            configuration = JAP_LOCAL.getConfiguration(
                "./JAP_LOCAL_WS.json", JAP_LOCAL_WS.getDefaultConfiguration)

            factory = JAP_LOCAL_WS.WSInputProtocolFactory(configuration)
            factory.protocol = JAP_LOCAL_WS.WSInputProtocol

            port = tcp.Port(configuration["LOCAL_PROXY_SERVER"]["PORT"],
                            factory, 50,
                            configuration["LOCAL_PROXY_SERVER"]["ADDRESS"],
                            reactor)
            port.startListening()

            self.port_JAP_LOCAL_WS = port

            return ""