You can access APIs blocked by CORS restriction by using either Proxyscotch or custom middleware. You can also use the Hoppscotch web extension to intercept requests and responses.

Proxy

  • Enable proxy from ”Settings page”.
  • You can replace the Proxy URL with your proxy middleware if you wish.

Middleware

Since CORS is as simple as adding some HTTP headers, it’s only blocked by the browser. You can build some proxy-like component that will make a call for you and get the response from the desired API. You add it to the headers and then send it back to Hoppscotch.

Browser extension

  1. Install the browser extension from the below links:

  2. Click on the Hoppscotch Browser Extension icon from the browser toolbar and ensure that hoppscotch.io is in your active origins. If you are using Hoppscotch Self-Host, add your own domain as a new origin

  3. Refresh the Hoppscotch web app.

  4. Open the interceptor and change the middleware to the browser extension

    You can either go to the settings and enable the use of the browser extension as shown below:

    Or you can open the interceptor menu and change the middleware as shown below:

    Origins

    The origin list defines the URLs that the extension can connect to. If you’re using hoppscotch.io, then you do not need to add any other origins. However, if you are using a self-hosted instance, you should add the domain of your self-hosted instance as an active origin.