Skip to content

Commit

Permalink
open localhost when listening on 0.0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
omriher committed Jul 23, 2015
1 parent e63fe60 commit 4a59f01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CTConsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ def do_open(self, line):
id = int(l[0])
request = CTCore.conversations[id].uri
host = CTCore.conversations[id].host
open_url = 'http://' + CTCore.HOST + ":" + str(CTCore.PORT) + "/" + host + request
server_addr = CTCore.HOST
if server_addr == "0.0.0.0":
server_addr = "127.0.0.1"

open_url = 'http://' + server_addr + ":" + str(CTCore.PORT) + "/" + host + request
print(" Opening {} in default browser".format(open_url))
import webbrowser
webbrowser.open(open_url)
Expand Down

0 comments on commit 4a59f01

Please sign in to comment.