Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use web page address when making request to reload proxy #625

Merged
merged 2 commits into from
Sep 21, 2024

Conversation

yopoyka
Copy link
Contributor

@yopoyka yopoyka commented Jul 9, 2024

Hello. I often use tailscale to share development process of web pages with my team. Using tailscale you can create a tunnel from your local machine with a public address such as machine.id.ts.net but air always connects to localhost so live reload can't work on my teammates browsers.

This pr makes browser reload script connect to web page's host.

It works with localhost:port and with regular addresses. It works with both http and https.
I've ran it on linux firefox, chrome and on macOS safari. Seems to be working all right.

Signed-off-by: Alexandra Fishova <yopoyka@yopoyka.com>
…ss on its own.

Signed-off-by: Alexandra Fishova <yopoyka@yopoyka.com>
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
runner/proxy.go 66.33% <100.00%> (-0.98%) ⬇️

@cosmtrek cosmtrek merged commit 6761441 into air-verse:master Sep 21, 2024
8 checks passed
jesses-code-adventures pushed a commit to jesses-code-adventures/air that referenced this pull request Sep 25, 2024
* Use web page address when making request to reload proxy

Signed-off-by: Alexandra Fishova <yopoyka@yopoyka.com>

* Create event source with just a path because browser can handle address on its own.

Signed-off-by: Alexandra Fishova <yopoyka@yopoyka.com>

---------

Signed-off-by: Alexandra Fishova <yopoyka@yopoyka.com>
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