fix(loader-client): the live-reload URL is always http://localhost, so it breaks over LAN and HTTPS

Đang mở
#137 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, typescript
Lĩnh vực
networking, web-dev

Hướng nghiên cứu

Start with apps/client/src/watch.ts and apps/website/src/watch.ts, then trace how the manifest publishes the watch URL and how the website opens the WebSocket. Check how --cert and --key reach the watch server. Done means the published port works from another device over HTTP and HTTPS, with connection logs reflecting the socket's open and close events.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

app:client app:website bug
Which app is this bug report for?

client

Issue description

The watch WebSocket server is always plain HTTP, even with --cert/--key, and its URL comes from server.url, which is http://localhost:<port>/ (client watch.ts#L6-L27). The website connects to it as-is (website watch.ts#L9).

$ curl localhost:39171/manifest
{"watch":{"enable":true,"url":"http://localhost:39172/"},...}
  • A browser on another device (e.g. a phone testing the game) connects to its own localhost, so live reload never works there.
  • On an HTTPS page served from a LAN address, a ws:// connection is mixed content and is blocked by the browser (not tested in a browser).
  • The website has no error/close handler, and logs "Connected to watcher" before the socket is open.

Expected: live reload works from any host the page is served from, over HTTP and HTTPS.

Suggested fix: publish only the watch port; the website builds the URL from location.hostname and uses wss: when the page is HTTPS. Serve the watch socket with the same tls options. Log on open and close.

Found during a read-only audit of main @ 044c766 (2026-11-11).

Code sample

No response

Versions
  • @nanoforge-dev/loader-client / @nanoforge-dev/loader-server / @nanoforge-dev/loader-website 1.7.0 (main @ 044c766)
  • Bun 1.3.14
  • Linux x86_64
Issue priority

Medium (should be fixed soon)

I have tested this issue on a development release

044c766

Ngôn ngữ chính
TypeScript
Star
1
Fork
0
Merge trung bình
17 giờ 25 phút
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NanoForge-dev/Loader

Tất cả issue của NanoForge-dev/Loader

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.