Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint.Cowboy2Adapter does not print both ipv4 and ipv6 when both are used #3992

Closed
chulkilee opened this issue Sep 14, 2020 · 2 comments
Closed

Comments

@chulkilee
Copy link
Contributor

Environment

  • Elixir version (elixir -v):
Erlang/OTP 23 [erts-11.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Elixir 1.10.4 (compiled with Erlang/OTP 23)
  • Phoenix version (mix deps): 1.5.4
  • NodeJS version (node -v): N/A
  • NPM version (npm -v): N/A
  • Operating system: macOS

Expected behavior

when listening on both ipv4 and ipv6, log message should show both addresses

config :my_app, MyAppWeb.Endpoint,
  http: [:inet6, :inet, port: 4000]

It binds to both ipv4 and ipv6, and should print both interfaces in the log correctly.

Example:

Running MyAppWeb.Endpoint with cowboy 2.8.0 at 0.0.0.0:4000 and ::4000 (http)

Actual behavior

It prints only the latter interface, not both

  • http: [:inet, :inet6, port: 4000] => ::4000
  • http: [:inet6, :inet, port: 4000] => 0.0.0.0:4000

Example:

Running MyAppWeb.Endpoint with cowboy 2.8.0 at 0.0.0.0:4000 (http)

Note that :ranch.info/0 does not return two entry - just one entry (like :ranch.get_addr/1 - when binding to two sockets - so without ranch changes it's tricky to know that.

@josevalim
Copy link
Member

I think it is fine, we don't have to show both. The goal is to show something people can access in development or access locally and not a comprehensive list. Thank you!

@chulkilee
Copy link
Contributor Author

The goal is to show something people can access in development or access locally and not a comprehensive list.

I disagree to this, since it's info log (not debug) and it does print out in default prod info from phoenix app by default.

However, since the underlying library does not provide this information in an easy way to get them.. and it's less likely to bind to two interface (it's more common to each app serve ipv4 and let load balancer handle ipv6), closing it for now makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants