Skip to content

Commit

Permalink
Browse tool uses real hostname not localhost, to allow -t browse when…
Browse files Browse the repository at this point in the history
… using ssh

Change-Id: Ic4be6527151a7ff68afab62e61951071ad5694b7
  • Loading branch information
rgeary1 committed May 22, 2013
1 parent 082d0be commit 07049a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/browse.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import http.server as httpserver
except ImportError:
import BaseHTTPServer as httpserver
import os
import socket
import subprocess
import sys
import webbrowser
Expand Down Expand Up @@ -183,8 +185,10 @@ def log_message(self, format, *args):
port = 8000
httpd = httpserver.HTTPServer(('',port), RequestHandler)
try:
print('Web server running on port %d, ctl-C to abort...' % port)
webbrowser.open_new('http://localhost:%s' % port)
hostname = socket.gethostname()
print('Web server running on %s:%d, ctl-C to abort...' % (hostname,port) )
print('Web server pid %d' % os.getpid(), file=sys.stderr )
webbrowser.open_new('http://%s:%s' % (hostname, port) )
httpd.serve_forever()
except KeyboardInterrupt:
print()
Expand Down

0 comments on commit 07049a3

Please sign in to comment.