How to defeat CORB (Cross-Origin Read Blocking) and allow javascript to access local web server running on localhost (127.0.0.1) over XHR:
It should be working now.
- Select a random domain and point it to 127.0.0.1 in your HOSTS file
- Direct your XHR connections to that domain instead of 127.0.0.1
- You will need to enable SSL/TLS on your local web server.
- If you are coding your own sockets server in C here is a guide on how to SSL enable them.
- Or you can base your simple local server on a light web server that supports SSL/TLS out of the box: abyssws I chose this faster solution and had it serve files dynamically dumped out by my existing logic to specific doc paths under the server's root.
- You will need to make sure that your local server's responses always include this CORS header: Access-Control-Allow-Origin: *
It should be working now.
No comments:
Post a Comment