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

[FEATURE REQUEST]Print all valid IP addresses when binding to addr any #2175

Open
achillis2016 opened this issue Jul 13, 2023 · 1 comment
Open

Comments

@achillis2016
Copy link

I likes iris very much. When I used it to start a webserver with listen string "0.0.0.0:8889" or ":8889",when the program start up , it print some listening info like behind:

Now listening on: http://0.0.0.0:8889
Application started. Press CTRL+C to shut down.

I think this display info is very unfriendly. Like vite (a node.js develop server),when the bind address is "0.0.0.0",it will display all avalible ip address on this computer,just like this:

  vite v2.9.15 dev server running at:

  > Network:  http://192.168.26.1:3100/                                                                                                               12:52:31
  > Network:  http://192.168.164.1:3100/                                                                                                              12:52:31
  > Network:  http://192.168.131.17:3100/                                                                                                             12:52:31
  > Local:    http://localhost:3100/                                                                                                                  12:52:31

This is more useful than the url "http://0.0.0.0:8889" which can not be directly used on web browser or other places, so I hope there can be some improvement on this issue. Thank you very much!

@kataras
Copy link
Owner

kataras commented Jul 30, 2023

Hello @achillis2016, sorry for the delay. I've made a commit which prints the web browser-accessible urls based on your request. Please upgrade using go get github.com/kataras/iris/v12@master and try it.

When :8080 or 0.0.0.0:8080:

Iris Version: 12.2.1

Now listening on:
> Network:  http://192.168.1.109:8080
> Network:  http://172.25.224.1:8080
> Local:    http://localhost:8080
Application started. Press CTRL+C to shut down.

Otherwise:

Iris Version: 12.2.1

Now listening on: http://192.168.1.109:8080
Application started. Press CTRL+C to shut down.

kataras added a commit that referenced this issue Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants