Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: print valid ipv6 multiaddrs in terminal #1854

Merged
merged 1 commit into from
Feb 11, 2019
Merged

Conversation

lidel
Copy link
Member

@lidel lidel commented Jan 30, 2019

Fixes #1853
(easy enough to do it as a drive-by, let me know if I should rebase this after #1844 is merged)

Before:

API listening on /ip4//tcp/
Gateway (read only) listening on /ip4//tcp/
Web UI available at http://::1:5002/webui

After:

API listening on /ip6/::1/tcp/5002/http
Gateway (read only) listening on /ip6/::1/tcp/9090/http
Web UI available at http://[::1]:5002/webui

@lidel lidel requested a review from alanshaw January 30, 2019 12:45
@ghost ghost assigned lidel Jan 30, 2019
@ghost ghost added the status/in-progress In progress label Jan 30, 2019
@alanshaw
Copy link
Member

alanshaw commented Feb 5, 2019

@lidel would you mind rebasing this now the Hapi 18 refactor has been merged?

@alanshaw
Copy link
Member

alanshaw commented Feb 7, 2019

ping @lidel

Fixes #1853

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel
Copy link
Member Author

lidel commented Feb 8, 2019

@alanshaw rebased :)

API listening on /ip6/::1/tcp/5002/http
Gateway (read only) listening on /ip6/::1/tcp/9090/http
Web UI available at http://[::1]:5002/webui
Daemon is ready

let uri = info.uri
// ipv6 fix
if (hostname.includes(':') && !hostname.startsWith('[')) {
// hapi 16 produces invalid URI for ipv6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed? We use hapi 18 now...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly still needed: I tried with vanilla hapi 18 and uri inside of apiServer.info was still broken (missing brackets), which produced broken ma:

{
  "created": 1549909555055,
  "started": 1549909555222,
  "host": "::1",
  "port": 5002,
  "protocol": "http",
  "id": "foo:5989:js0o4qjz",
  "uri": "http://::1:5002",
  "address": "::1",
  "ma": "/ip4//tcp/"
}

Due to this the line should stay :)

Suggested change
// hapi 16 produces invalid URI for ipv6
// hapi 18 produces invalid URI for ipv6

@alanshaw alanshaw merged commit 35fd541 into master Feb 11, 2019
@alanshaw alanshaw deleted the fix/ipv6-in-stdout branch February 11, 2019 19:20
@ghost ghost removed the status/in-progress In progress label Feb 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants