| 861 | return self._base_address |
| 862 | |
| 863 | def start(self): |
| 864 | # Create a web server and define the handler to manage the incoming |
| 865 | # request |
| 866 | self._sserver = ThreadedHTTPServer((self._address, self._sport), self._gui, self._auth, |
| 867 | self._multiple_instance, self._enable_file_cache, |
| 868 | self._update_interval, self._websocket_timeout_timer_ms, |
| 869 | self._pending_messages_queue_length, self._title, |
| 870 | self, self._certfile, self._keyfile, self._ssl_version, *self._userdata) |
| 871 | shost, sport = self._sserver.socket.getsockname()[:2] |
| 872 | self._log.info('Started httpserver http://%s:%s/'%(shost,sport)) |
| 873 | # when listening on multiple net interfaces the browsers connects to localhost |
| 874 | if shost == '0.0.0.0': |
| 875 | shost = '127.0.0.1' |
| 876 | self._base_address = 'http://%s:%s/' % (shost,sport) |
| 877 | if self._start_browser: |
| 878 | try: |
| 879 | import android |
| 880 | android.webbrowser.open(self._base_address) |
| 881 | except ImportError: |
| 882 | # use default browser instead of always forcing IE on Windows |
| 883 | if os.name == 'nt': |
| 884 | webbrowser.get('windows-default').open(self._base_address) |
| 885 | else: |
| 886 | webbrowser.open(self._base_address) |
| 887 | self._sth = threading.Thread(target=self._sserver.serve_forever) |
| 888 | self._sth.daemon = False |
| 889 | self._sth.start() |
| 890 | |
| 891 | def serve_forever(self): |
| 892 | # we could join on the threads, but join blocks all interrupts (including |