ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.58k stars 187 forks source link

Scripting interferes with Map Remote #1662

Open ashton-seek opened 1 year ago

ashton-seek commented 1 year ago

Description

It seems having a Map Remote setup for a domain will not work correctly if there is also a Scripting script running on that domain.

Steps to Reproduce

Given two domains, A and B that respond to the same requests.

  1. Create a script matching domain A with a regex, any method running on Requests only. Add a header to the request and return the modified request.
  2. Create a Map Remote rule for domain A to map to domain B and add a query parameter
  3. Make a request to A on some client
  4. Disable Scripting
  5. Make a request to A on some client again

Current Behavior

The Map Remote does not map to domain B when Scripting is enabled. Step 3 behaves incorrectly.

Expected Behavior

All requests map to domain B even when scripting is enabled.

Environment

NghiaTranUIT commented 1 year ago

Hey @ashton-seek it's how we designed it. A request can be executed by either the Scripting or Map Remote. They won't work together.

You can write a simple Map Remote logic inside your Scripting, so it will work.

Here is the snippet code: https://docs.proxyman.io/scripting/snippet-code#change-request-destination-scheme-host-port-path