Proxy Mode

Proxy Mode allows you to forward requests to your real API while maintaining the ability to mock specific endpoints. This hybrid approach gives you the best of both worlds.

Why Use Proxy Mode?

Parallel Development

Start frontend development immediately using mocked endpoints while the backend team works on the real API. As real endpoints become available, simply switch them from mock to proxy mode - no code changes required in your frontend application.

Mixed Environment Testing

Connect to your production API while mocking specific endpoints for testing. Perfect for simulating error scenarios or testing new features without affecting the real API. You can mock problematic endpoints while keeping the rest of the system connected to the real API.

Setting Up Proxy Mode

  1. Enable Proxy Mode in the dashboard

    Toggle the Proxy Mode switch in the top-right corner

  2. Enter your base URL

    Example: http://api.yourserver.com

  3. All non-mocked requests will now be forwarded to your base URL

Connecting to Local API Service

Recommended: Use Apimimic CLI utility to proxy requests to your local API server. This is the fastest and most convenient way to use Apimimic on local api server / backend.

If you still wish to connect to your local api from the Apimimic online service, you'll need:

  • Your public IP address
  • An open port on your machine (e.g., 3000, 8080)
  • Proper firewall configuration to allow incoming connections

Security Note: When exposing your local server, ensure it's properly secured and only expose it temporarily for testing or development purposes.

Example Configuration:

Base URL: http://123.456.789.0:3000
Proxy Headers: Authorization: Bearer your-token

Proxy Headers

Proxy headers are forwarded to your base URL with each request. They're particularly useful for:

  • Authentication tokens
  • API keys
  • Custom headers required by your API

Example Headers:

Authorization: Bearer eyJ0eXAiOiJKV1QiLC...
X-API-Key: your-api-key
Custom-Header: value

Apimimic automatically handles cookie modifications to ensure proper functionality in modern browsers:

  • SameSite=Lax cookies are automatically converted to SameSite=None; Secure
  • This ensures cookies work correctly in cross-origin scenarios
  • No configuration needed - this happens automatically

Note: The Secure flag requires HTTPS. Apimimic handles this automatically as all traffic goes through HTTPS.