trunk-rs / trunk

Build, bundle & ship your Rust WASM application to the web.
https://trunkrs.dev/
Apache License 2.0
3.52k stars 253 forks source link

Trunk serve does not respect custom address #862

Open joshvoigts opened 2 months ago

joshvoigts commented 2 months ago

System details

macos 14.6.1

Steps to reproduce

  1. Run trunk serve --address 0.0.0.0
  2. Observe that trunk runs on localhost instead:
2024-09-01T17:10:15.467034Z  INFO 🚀 Starting trunk 0.20.3
2024-09-01T17:10:15.473654Z  INFO 📦 starting build
2024-09-01T17:10:18.121126Z  INFO applying new distribution
2024-09-01T17:10:18.122946Z  INFO ✅ success
2024-09-01T17:10:18.123208Z  INFO 📡 serving static assets at -> /
2024-09-01T17:10:18.123247Z  INFO 📡 server listening at:
2024-09-01T17:10:18.123250Z  INFO     🏠 http://127.0.0.1:8080/

Relates to: https://github.com/trunk-rs/trunk/issues/467

ctron commented 2 months ago

I do recall some issues with older trunk versions. IIRC, it was only a displaying issue though. Running 0.21.0-rc.3 (on Fedora 40), I get:

➜  vanilla git:(main) trunk serve --address 0.0.0.0
2024-09-02T06:49:48.205970Z  INFO 🚀 Starting trunk 0.21.0-rc.3
2024-09-02T06:49:48.220263Z  INFO 📦 starting build
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
2024-09-02T06:49:48.672576Z  INFO applying new distribution
2024-09-02T06:49:48.674531Z  INFO ✅ success
2024-09-02T06:49:48.674576Z  INFO 📡 serving static assets at -> /
2024-09-02T06:49:48.674867Z  INFO 📡 server listening at:
2024-09-02T06:49:48.674872Z  INFO     🏠 http://127.0.0.1:8080/
2024-09-02T06:49:48.674877Z  INFO     💻 http://192.168.122.1:8080/
2024-09-02T06:49:48.674880Z  INFO     💻 http://192.168.130.1:8080/
2024-09-02T06:49:48.674883Z  INFO     💻 http://192.168.188.92:8080/