node-livereload icon indicating copy to clipboard operation
node-livereload copied to clipboard

Turn on CORS

Open FossPrime opened this issue 3 years ago • 4 comments

Most browsers won't allow connections over the "Internet" when CORS is not configured. This is a problem in Glitch, AWS, GCP, CodeSandbox and other setups where HTTPS encryption is handled by a transparent reverse proxy. Usually nginx, tiny, Apache Mod-proxy, Route 53 or Google Load Balancer.

FossPrime avatar Jun 03 '21 05:06 FossPrime

@rayfoss this is a good idea if it's required, but I have a couple thoughts here.

First, I feel this should be opt-in, which means options for the server and the CLI implementation. Second, are the POST and OPTIONS methods really necessary for the allowlist? Finally, should we split out the CORS headers from the others and merge the header objects?

Also, I am about to flip this over to standard JS to get rid of the CoffeeScript requirement. I just haven't done the release. How urgent is this for you?

napcs avatar Jun 23 '21 03:06 napcs

It's not urgent for me at all.

I recall only the GET request is needs it... good point.

This is almost exclusively used for local development, DDOS isn't a huge concern, but I lean towards production ready defaults... so I'm leaning towards a super simple option.

Test tools:

FossPrime avatar Jun 25 '21 02:06 FossPrime

If this is merged, https://github.com/thgh/rollup-plugin-livereload/issues/66 will make use of it.

thgh avatar Aug 02 '21 15:08 thgh

If this is merged, thgh/rollup-plugin-livereload#66 will make use of it.

Looks like it's still not released for some reason. Also I don't see how this patch allows to extend this to support COEP.

galoko avatar Jun 24 '22 23:06 galoko