go-echarts / statsview

🚀 A real-time Golang runtime stats visualization profiler
MIT License
575 stars 52 forks source link

problems using 0.0.0.0 as serve address #18

Open simobgl opened 3 years ago

simobgl commented 3 years ago

Trying to expose the stats on all interfaces the same value is used building the page, and the browsers will then interpret 0.0.0.0 as localhost

chenjiandongx commented 3 years ago

@joegalaxy71 what is your expected result?

simobgl commented 3 years ago

It should bind to 0.0.0.0 on the server, autodiscover a valid public IP and use that address to render the HTML, allowing statsview to be reachable from outside. Thank you for your work, it's a nice package.

chenjiandongx commented 3 years ago

Statsview provide a viewer.WithLinkAddr() method to set the request address to render the HTML hence you could put your public IP here

chaokw commented 3 years ago

it could be reachable from outside by setting address as below: viewer.SetConfiguration(viewer.WithAddr(":12345"), viewer.WithLinkAddr("11.82.205.147:12345"))

KubeStacker commented 2 years ago

It would be hard to use in a cloud native golang app(because IP is not fixed, the container IP or service IP is always random). @chenjiandongx has any idea?