Exemplo n.º 1
0
 def start_httpd(self):
     host = iface.get_lan_ip()
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     s.bind(("", 0))
     port = s.getsockname()[1]
     s.close()
     self.baseurl = "http://%s:%d/" % (host, port)
     self.logger.info("running webserver on %s" % self.baseurl)
     self.httpd = MozHttpd(host=host, port=port, docroot=os.path.join(os.path.dirname(__file__), "www"))
     self.httpd.start()
Exemplo n.º 2
0
 def start_httpd(self):
     host = iface.get_lan_ip()
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     s.bind(("",0))
     port = s.getsockname()[1]
     s.close()
     self.baseurl = 'http://%s:%d/' % (host, port)
     self.logger.info('running webserver on %s' % self.baseurl)
     self.httpd = MozHttpd(host=host,
                           port=port,
                           docroot=os.path.join(os.path.dirname(__file__), 'www'))
     self.httpd.start()