コード例 #1
0
ファイル: ServerThread.py プロジェクト: sebmaynard/pyload
    def start_server(self, server):

        from servers import ServerAdapter

        if issubclass(server, ServerAdapter):

            if self.https and not server.SSL:
                log.warning(
                    _("This server offers no SSL, please consider using threaded instead"
                      ))
            elif not self.https:
                self.cert = self.key = None  # This implicitly disables SSL
                # there is no extra argument for the server adapter
                # TODO: check for openSSL ?

            # Now instantiate the serverAdapter
            server = server(self.host, self.port, self.key, self.cert, 6,
                            self.debug)  # todo, num_connections
            name = server.NAME

        else:  # server is just a string
            name = server

        log.info(
            _("Starting %(name)s webserver: %(host)s:%(port)d") % {
                "name": name,
                "host": self.host,
                "port": self.port
            })
        webinterface.run_server(host=self.host, port=self.port, server=server)
コード例 #2
0
ファイル: ServerThread.py プロジェクト: f3l/shareacc
    def start_server(self, server):

        from servers import ServerAdapter

        if issubclass(server, ServerAdapter):

            if self.https and not server.SSL:
                log.warning(_("This server offers no SSL, please consider using threaded instead"))

            # Now instantiate the serverAdapter
            server = server(self.host, self.port, self.key, self.cert, 6, self.debug) # todo, num_connections
            name = server.NAME

        else: # server is just a string
            name = server

        log.info(_("Starting %(name)s webserver: %(host)s:%(port)d") % {"name": name, "host": self.host, "port": self.port})
        webinterface.run_server(host=self.host, port=self.port, server=server)
コード例 #3
0
ファイル: ServerThread.py プロジェクト: 4Christopher/pyload
    def start_server(self, server):

        from servers import ServerAdapter

        if issubclass(server, ServerAdapter):

            if self.https and not server.SSL:
                log.warning(_("This server offers no SSL, please consider using threaded instead"))
            elif not self.https:
                self.cert = self.key = None # This implicitly disables SSL
                # there is no extra argument for the server adapter
                # TODO: check for openSSL ?

            # Now instantiate the serverAdapter
            server = server(self.host, self.port, self.key, self.cert, 6, self.debug) # todo, num_connections
            name = server.NAME

        else: # server is just a string
            name = server

        log.info(_("Starting %(name)s webserver: %(host)s:%(port)d") % {"name": name, "host": self.host, "port": self.port})
        webinterface.run_server(host=self.host, port=self.port, server=server)