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

Possible to specify a different path prefix? #162

Open
krumware opened this issue Mar 30, 2022 · 2 comments
Open

Possible to specify a different path prefix? #162

krumware opened this issue Mar 30, 2022 · 2 comments

Comments

@krumware
Copy link

What version of Livereload are you using?

0.9.3

What OS are you using?

Linux

What web browser are you using? (Browser name and specific version please)

Chrome

Expected result

I'd like to specify a non-root path, say "localhost:3002/{path}/livereload.js

Actual result

It doesn't look like this is possible, I believe the route checks strictly for {host}:{port}/livereload.js
I'm using rollup-plugin-livereload to inject the request for the livereload plugin in (live and remote) dev environments, but can't easily serve a secondary port while stripping a path prefix, without using a more advanced load balancer. Specifying a path would solve this, but i'm not certain if it's possible. The source looks like it strictly requires livereload.js to be served from the host root path.

Thanks in advance for help!

Steps to reproduce issue

Why is this important?

@napcs
Copy link
Owner

napcs commented Apr 29, 2022

@krumware This actually wouldn't be terribly difficult to add, but I don't know if it's worth adding the options, docs, etc given the specificity of the use case. Can you give me an idea of how common this would be and more detail on why someone would want to do this? I think I understand but I'd like a clearer picture.

@krumware
Copy link
Author

I'm doing this from memory, so apologies if this is off base:

I think the most common example may be if I deploy multiple front ends at different paths on the same port.

I may have app1 app2 and apple, which each have separate live reload instances. But they each are accessible via path prefix, so mysite/app1, mysite/app2, and mysite/app3.

When deploying to a live environment, I cant open any port I choose, so I can't use separate ports for each frontend in addition to each live reload server. I need to use paths to direct traffic in this instances.

What I can do, is have my load balancer direct certain paths to certain internal ports. Such as mysite:80/app1/livereload.js -> internalservice:3002/livereload.js, but I had trouble, I believe, with request header matching and the way it seems to function with the path match with the port and served at root. So the socket and script are not accessible. Does that make sense?

Thanks for the help!

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

No branches or pull requests

2 participants