Skip to content

Commit

Permalink
fix #1756 -- use correct IPv6 URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwpolska committed Jun 2, 2015
1 parent e23b70a commit 5133ac3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions nikola/plugins/command/auto/__init__.py
Expand Up @@ -187,10 +187,15 @@ def __call__(self, environ, start_response):
app=Mixed(handler_cls=LRSocket)
)
ws.initialize_websockets_manager()
self.logger.info("Serving on port {0}...".format(port))

# Yes, this is racy
self.logger.info("Serving HTTP on {0} port {1}...".format(host, port))
if browser:
if options['ipv6'] or '::' in host:
server_url = "http://[{0}]:{1}/".format(host, port)
else:
server_url = "http://{0}:{1}/".format(host, port)

self.logger.info("Opening {0} in the default web browser...".format(server_url))
# Yes, this is racy
webbrowser.open('http://{0}:{1}'.format(host, port))

try:
Expand Down

0 comments on commit 5133ac3

Please sign in to comment.