harlanc / xiu

A simple,high performance and secure live media server in pure Rust (RTMP[cluster]/RTSP/WebRTC[whip/whep]/HTTP-FLV/HLS).🦀
https://www.rustxiu.com
MIT License
1.61k stars 168 forks source link

http api doesn't listen on 0.0.0.0 - can't be used in docker container #86

Closed DukeFerdinand closed 6 months ago

DukeFerdinand commented 6 months ago

Issue summary

The built in http api doesn't listen on 0.0.0.0 like all of the rest of the services, making it unusable when running inside of a docker container.

Here's some supporting logs. Note how the last log doesn't even show a host that it's listening on 👀

[2023-12-25T07:34:35Z INFO  hls::server] Hls server listening on http://0.0.0.0:8080
[2023-12-25T07:34:35Z INFO  rtmp::rtmp] Rtmp server listening on tcp://0.0.0.0:1935
[2023-12-25T07:34:35Z INFO  xiu::api] Http api server listening on http://:8000

Proposed Solutions

Can we update the default host for the http api to listen on 0.0.0.0 list the rest of the services?

Please let me know if you'd like me to do this and I can make a PR!

Context

OS: macOS Platform: Docker Config:

[hls]
enabled = true
port = 8080
need_record = true

[rtmp]
enabled = true
port = 1935
harlanc commented 6 months ago

please go ahead, deploy using docker is very convenient.

DukeFerdinand commented 6 months ago

Made the PR! This one isn't very big, just adds the 0.0.0.0 host instead of 127.0.0.1 host 😎