Test localhost APIs from the Requestarium web app

You open the Requestarium web app on a colleague's machine, or on a Chromebook, pick the Local environment and press Send on http://localhost:8080/health. It fails. That's expected: in the browser, requests go through the Requestarium server, and the server can't see your laptop.

The desktop app, the CLI and the IDE extensions send requests from your machine, so they don't have this problem. For the web app, the Requestarium browser extension fills the gap.

Why the server can't reach localhost

localhost means "this computer". When the Requestarium server sends a request to http://localhost:8080, it means the server itself, not your laptop. The same goes for 10.x.x.x addresses, *.internal names and anything only reachable over your VPN. For safety, Requestarium Cloud refuses private and loopback addresses outright.

Choose where requests are sent from

The web app's Send requests from setting has three options:

OptionWhat happens
Autolocalhost and private-network addresses go from this browser through the extension; everything else through the Requestarium server
This browserEvery request goes from this browser through the extension, so VPN and internal hostnames work too
Requestarium serverEvery request goes through the server. Public addresses only

Auto is right for most people. Choose This browser if your company's staging hosts have public-looking names but only resolve inside the VPN.

The card also says whether the extension was found, whether it's too old for the web app, and whether it has been allowed yet.

The first request: two approvals

The first time the web app hands a request to the extension, an extension window opens: "Send from this browser?". It's a separate window, so a web page can't approve it for you.

  1. Allow the web app. The extension remembers it; the options page lists allowed web apps with Remove.
  2. Allow the target site, for example http://localhost:8080. The extension only sends to sites you've allowed.

After that, requests to the same site go straight through.

What's different from the desktop app

Requests sent from a browser follow browser rules:

  • Some headers can't be set by a page or an extension (Cookie, Origin, Referer, User-Agent and a few more). They're dropped, and the web app tells you which.
  • Set-Cookie on a response can't be read.
  • Responses are capped at 10 MB.
  • Your browser cookies are not sent along; requests use credentials: 'omit'.

If you need exact control over those headers, use the desktop app or the CLI for that request.

Self-hosted web app

On a self-hosted installation, open the extension's options page and set the Web app URL to your own address, then grant it. The bridge then works with your server's web app exactly as with app.requestarium.com.