Browsers apply "the same" access control , unless the site explicitly allows requests between sources (via CORS or JSONP). Thus, if the site you are trying to access does not allow cross-queries, you cannot receive data directly from the site using only a browser. The browser applies the same source restrictions that the target site requests.
This is NOT security for the server, as there are many ways around this. It applies only to one specific type of browser access (although this particular type of access protection is useful).
This means that to transfer data to the browser, you will need to use some third-party agent (except the browser) that can receive data for you. The two most common ways to do this are:
Your own server. You make a request to your own server to get some content from another server. Then your server receives data from another server and returns it to you in the browser.
Proxy server. There are several preconfigured proxies that are created only to perform the actions described in option No. 1. You can use the proxy service or install your own proxy server to do this for you, or configure your web server for this feature.
Thus, you cannot circumvent cross-origin restrictions from a collaborative browser. But you can get around them from the server. This is because CORs restrictions are only implemented in the browser. They are not a server limitation. The browser asks the destination server which CORS policies are used and applies them only in the browser. Some other server making a request to this server does not need to pay any attention to COR policies.
source share