Skip to main content
Mock API Builder
LearnAboutContact
Learning Center/Proxy Mode
Advanced FeatureNew

Proxy Mode

Control how your endpoints respond: use mock data, forward to real APIs, or combine both with hybrid mode.

What is Proxy Mode?

Proxy Mode is a powerful feature that lets you control how your Mock API Builder endpoints respond to requests. When you import an OpenAPI spec from an external API, you can choose to return mock data, forward requests to the real API, or use a combination of both.

Mock Mode
Default

Returns generated mock data based on your endpoint configurations and response templates.

Best for:

  • Frontend development
  • Offline testing
  • Controlled test scenarios
Proxy Mode
Live Data

Forwards all requests to the original external API and returns real responses.

Best for:

  • Integration testing
  • Production debugging
  • Real data validation
Hybrid Mode
Advanced

Uses mock data when available, falls back to the real API for unconfigured endpoints.

Best for:

  • Partial API mocking
  • Gradual migration
  • Mixed testing scenarios

URL Transformation

When you import an OpenAPI spec with an external base URL, Mock API Builder automatically transforms it to work with our routing system.

How URL Transformation Works

Original URL (from OpenAPI spec):

https://petstore.swagger.io/v2

Transformed URL (Mock API Builder):

/api/petstore.swagger.io/v2
Transformation Examples
  • https://api.example.com/v1 → /api/api.example.com/v1
  • http://localhost:3001 → /api/localhost:3001
  • https://petstore.swagger.io/v2 → /api/petstore.swagger.io/v2
Protocol Detection
  • External URLs default to HTTPS
  • localhost, 127.0.0.1 use HTTP
  • Original protocol stored in project settings

How to Configure Proxy Mode

Step-by-Step Guide
  1. 1

    Import an OpenAPI Spec

    Import a spec from an external URL (e.g., Swagger Petstore)

  2. 2

    Open Project Settings

    Click the gear icon in your project dashboard

  3. 3

    Find Proxy Mode Section

    This section only appears for projects with external API URLs

  4. 4

    Select Your Mode

    Choose Mock, Proxy, or Hybrid based on your needs

  5. 5

    Save Changes

    Your mode change takes effect immediately

Use Cases

Frontend Development
Use Mock Mode for consistent, predictable responses

During frontend development, you want consistent data that doesn't change unexpectedly. Mock Mode gives you complete control over the response data, allowing you to test edge cases and specific scenarios.

javascript
Integration Testing
Use Proxy Mode for real API validation

When you need to validate that your application works with the real API, switch to Proxy Mode. All requests are forwarded to the original API, returning live data.

javascript
Gradual Migration
Use Hybrid Mode for partial mocking

Hybrid Mode is perfect when you want to mock some endpoints while keeping others connected to the real API. This is useful when migrating from a real API to a mock setup, or when you only need to control specific endpoints.

  • Endpoints with mock data configured → Return mock data

  • Endpoints without mock data → Forward to real API

Important Notes

Proxy Mode Requirements

Proxy mode only works for projects imported from external OpenAPI specs.

  • Original API must be accessible from your server

  • CORS policies may affect browser requests

  • API authentication must be handled separately

Best Practices
  • Start with Mock Mode for development

  • Switch to Proxy Mode for integration tests

  • Use Hybrid Mode for gradual transitions

  • Document which mode is used in different environments

Related Articles

OpenAPI Import
Learn how to import OpenAPI/Swagger specifications
Response Customization
Customize mock responses for your endpoints
Previous: Importing from OpenAPI/SwaggerNext: Testing & Debugging APIs
Mock API Builder

Built for developers, by developers

LearnSupport / ContactPrivacy PolicyTerms of Service

© 2026 Mock API Builder. All rights reserved.

Learning Center
← Back to Dashboard
Learning Center
← Back to Dashboard