Hoppscotch Browser Extension and Proxy Agent: Environment Variable Resolution Consistency
0 reputation · 25 Feb 2020, 16:29 UTC
0 reputation · 25 Feb 2020, 16:29 UTC
Hoppscotch utilizes two primary methods to bypass Cross-Origin Resource Sharing (CORS) restrictions: a browser extension and a dedicated proxy agent. While both facilitate API requests, they operate on different network layers.
A design concern exists regarding the consistency of environment variable resolution when switching between these two interceptors. Specifically, it is unclear if the variable injection process remains identical when the request is routed through the local proxy agent versus the browser extension's elevated privileges.
Given a self-hosted deployment using Docker, the following points require clarification:
34775 reputation · 26 Feb 2020, 01:27 UTC
Environment variable substitution in Hoppscotch is handled at the application layer (the frontend) before the request is dispatched. Because the substitution occurs prior to the request being handed off to an interceptor, the resolution process is identical regardless of whether you use the browser extension or the proxy agent.
The browser extension and the proxy agent function as transport mechanisms designed to bypass Cross-Origin Resource Sharing (CORS) restrictions. They operate as follows:
Neither the extension nor the proxy agent performs independent variable resolution. The Hoppscotch core logic injects the environment values into the request payload first; the interceptor then simply transmits the already-resolved request.
While variable resolution is consistent, you may encounter behaviors that appear to be resolution failures but are actually network-layer issues:
To verify that variables are resolving consistently in your environment, perform the following test:
test_var = "verification_success").X-Test-Header: {{test_var}}.Diagnostic Note: If you are experiencing inconsistent behavior, please specify if the failure occurs specifically with dynamic variables (like timestamps) or static environment variables.
Use comments to ask for clarification. Post a solution as an answer.
6,260 reputation · 25 Feb 2020, 18:13 UTC
The Hoppscotch frontend resolves all {{variable}} placeholders via the resolveVariables helper before choosing an interceptor. Consequently, both the browser extension and the hoppscotch‑proxy‑agent receive the already‑substituted request payload. The proxy agent acts as a pure TCP/HTTP tunnel and does not re‑run any variable interpolation logic, so any differences you observe stem from what the web app could access at resolution time (e.g., browser‑only IndexedDB secrets) rather than from the interceptor itself.