Skip to content

Add configurable host binding for external access#13

Open
crankycoder wants to merge 1 commit intoselimacerbas:mainfrom
crankycoder:main
Open

Add configurable host binding for external access#13
crankycoder wants to merge 1 commit intoselimacerbas:mainfrom
crankycoder:main

Conversation

@crankycoder
Copy link
Copy Markdown

This is stacked on : selimacerbas/live-server.nvim#3

  • Add host config option (default: 127.0.0.1, set to 0.0.0.0 for external access)
  • Pass host to live-server when starting
  • Update lock.is_server_alive and remote.send_event to accept host parameter
  • Update browser URL to use configured host
  • Add minimal test harness

- Add host config option (default: 127.0.0.1, set to 0.0.0.0 for external access)
- Pass host to live-server when starting
- Update lock.is_server_alive and remote.send_event to accept host parameter
- Update browser URL to use configured host
- Add minimal test harness
Copy link
Copy Markdown
Owner

@selimacerbas selimacerbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @crankycoder, thanks for this — the host config itself is clean and well-tested, and we just shipped the live-server.nvim side in v1.3.0.

Before merging this PR, could you split it into two? The reason: it bundles two independent feature sets, and they should be reviewable / revertable separately.

PR A: host config (this PR, scoped down)

  • host config field
  • lock.is_server_alive(host, port) signature change
  • remote.send_event(host, port, ...) signature change
  • Browser URL uses configured host
  • The test harness (tests/host_config_test.lua)

PR B: browser opening improvements (new PR)

The changes in util.open_in_browser() are useful but unrelated to host config:

  1. vim.notify URL always
  2. vim.ui.open fallback
  3. vim.fn.executable() checks
  4. on_exit error handling

These are 4 separate improvements and they touch the same function that PR #14 (just merged) modified for WSL support — so you'll need to rebase regardless.

I'll happily merge both PRs. Splitting just keeps the history clean and makes it easier to land each piece without holding the other hostage.

Let me know if you'd prefer me to do the split for you (cherry-picking your commits into two branches) — happy to take that on if it's easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants