Proxyman
HomepageDownload
  • Overview
  • Changelog
  • License
  • License Manager
  • Raycast
  • Command-line
  • Security Compliance
  • Proxyman iOS
    • Proxyman for iOS
    • Map Local for iOS
    • Breakpoint for iOS
    • Tutorial for iOS
      • Map Local for iOS Tutorial
      • Breakpoint for iOS Tutorial
  • Debug on Devices
    • macOS
    • iOS Device
    • iOS Simulator
    • tvOS & watchOS
    • Android Device & Emulator
      • Automatic Script for Android Emulator
      • Sample Android Project
    • Firefox
    • Java VMs
    • Python
    • Ruby
    • NodeJS
    • Rust
    • Golang
    • React Native
    • Flutter
    • HTTP Clients
    • Docker
    • ElectronJS
    • NextJS (fetch)
  • Automatic Setup
    • Automatic Setup
    • Manual Setup
    • Troubleshooting
  • Atlantis
    • Atlantis for iOS
  • BASIC FEATURES
    • Proxyman Proxy Helper Tool
    • Request / Response Previewer
    • SSL Proxying
    • Bypass Proxy List
    • Import / Export
    • Content Filter
    • Multiple Tabs
    • Horizontal/Vertical/Window Layout
    • Copy as
    • Custom Previewer Tab
    • Custom Header Column
    • Regex (Regular Expression)
    • Filter JSON Response
    • Highlight by Color and Add Comment
    • Import / Export Settings
    • Multipart Form-Data Previewer
    • JSONPath
    • Customize Toolbar
    • Localization
    • Quick Preview
  • ADVANCED FEATURES
    • Repeat
    • Edit & Repeat
    • Compose new Request
    • No Caching
    • Breakpoint
    • Breakpoint Templates
    • Map Local (File)
    • Map Local (Directory)
    • Map Remote
    • External Proxy
    • Save Session
    • Protobuf
    • WebSocket
    • Clear Session
    • Block List
    • Allow List
    • Charles Proxy Converter
    • Custom Certificates
    • GraphQL
    • Network Conditions
    • Multiple Filters
    • Custom Filters
    • Publish to Gist
    • Reverse Proxy
    • Code Generator
    • Diff
    • Access Control
    • DNS Spoofing
    • SOCKS Proxy
    • Swagger OpenAPI
    • TLS Key Logging
  • Proxyman Windows
    • Install Certificate
    • WSL
  • Scripting
    • Scripting
    • async/await Request
    • Addons
    • Built-in JS Libraries
    • Write your own Addons
    • Snippet Code
    • Environment Variables
  • Troubleshooting
    • Proxyman does not work with VPN apps
    • My Remote Devices (iOS/Android) could not connect to Proxyman?
    • iOS 16 and iOS 17 issues
    • SSL Error from HTTPS Request/Response
    • I could not see any requests from my localhost server
    • I could not see any HTTP traffic from my NodeJS, Python, or Ruby scripts
    • *.local requests do not appear on Proxyman
    • I couldn't see any traffics on Proxyman
    • I couldn't see any requests from 3rd-party network libraries
    • [Breakpoint] Modify Request/Response by Raw Message
    • Could not change Proxyman App Icons
    • Lost data after updating Proxyman app?
    • Proxyman consumes too much RAM & unresponsive
Powered by GitBook
On this page
  • 1. What's it?
  • 2. Benefits
  • With an HTTP Message
  • With a Local File
  • With <FILE_URL> flag
  • 2. How to use
  • 3. Map Local with GraphQL Requests
  • 4. Map Local with Scripting Tool ✅
  1. ADVANCED FEATURES

Map Local (File)

Map a file as a response of requests

PreviousBreakpoint TemplatesNextMap Local (Directory)

Last updated 9 months ago

1. What's it?

Image for: 1. What's it?

The Map Local Tool enables you to use the content of local files as an HTTP Response to your requests.

You can do Map Local for GraphQL with the Scripting Tool ()

You can combine Map Local with Breakpoint to modify the content on the fly (2.16.0+)

2. Benefits

Image for: 2. Benefits
  • Define a Response with Status Code, Headers, and Body -> Mock to a given Request -> Easily to test some edge cases without waiting for the server's update.

  • Mock Fake API with a local File: It's useful for developers to try out the testing APIs that are not in production.

With an HTTP Message

  1. Right Click on your request on the main table -> Tools -> Map Local -> Proxyman will automatically create a new rules with a current Response

  2. Feel free to change the Status Code, Headers and the JSON Body

  3. Done

  4. Re-sent your request -> New Response is mapped.

With a Local File

  • Click on the Select Local File button and select any files. Supports: Text, JSON, Binary, Image

With <FILE_URL> flag

  • It's useful to map to a given file and able to provide the Status Code and Response Headers.

  • Work with JSON, Text, Binary, Image etc

  • Make sure to provide Content-Type header, so your client can work properly

HTTP/1.1 200 OK
Content-Type: application/json

<FILE_URL="~/Desktop/myjson.json">

2. How to use

Image for: 2. How to use
  1. Right-click on the Request (which already has a Response) -> Tools -> Map Local. Proxyman will create a rule with the current Response Body (The file is stored in your Desktop folder)

  2. We can directly change the Response body.

  3. Make a request and observe the new Response Body.

3. Map Local with GraphQL Requests

Image for: 3. Map Local with GraphQL Requests

From Proxyman 2.27.0+, Map Local can work with GraphQL Request by a specific QueryName. Please check out the following GraphQL Document.

GraphQL

4. Map Local with Scripting Tool ✅

Image for: 4. Map Local with Scripting Tool ✅

If you would like to do Map Local with complicated rules, you might check out since it's easier to achieve the same result.

Please check out these to understand how to map a local file with Javascript Code.

Scripting
Define Status Code, Headers and Body
Create a Map Local with curernt Response
Snippet Code
Snippet Code