[GH-ISSUE #1719] Why Map Remote can't work with Scripting enabled? #1712

Open
opened 2026-03-03 19:53:44 +03:00 by kerem · 6 comments
Owner

Originally created by @4332weizi on GitHub (Jul 20, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1719

Description

I have some URLs map remote enabled, for example, map remote https://host/path/* to http://192.168.1.1:8080/path/* , and it works fine.
But the map remote rule can't work when I add the script to URLs */path/*.

Steps to Reproduce

  1. Add map remote rule: https://host/path/* to http://192.168.1.1:8080/path/*
  2. Test the map remote rule, it works.
  3. Add Scripting rule: */path/* and add some string to the response body.
  4. Test map remote rule in step 1. It can't work.

Current Behavior

Map Remote can't work with Scripting enabled

Expected Behavior

Map Remote and Scripting both work fine.

Environment

  • App version: Proxyman 4.9.0
  • macOS version: macOS Ventura 13.4.1 (22F82) Apple M1
Originally created by @4332weizi on GitHub (Jul 20, 2023). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1719 ## Description I have some URLs map remote enabled, for example, map remote https://host/path/* to http://192.168.1.1:8080/path/* , and it works fine. But the map remote rule can't work when I add the script to URLs \*/path/\*. ## Steps to Reproduce 1. Add map remote rule: https://host/path/* to http://192.168.1.1:8080/path/* 2. Test the map remote rule, it works. 3. Add Scripting rule: \*/path/\* and add some string to the response body. 4. Test map remote rule in step 1. It can't work. ## Current Behavior `Map Remote` can't work with `Scripting` enabled ## Expected Behavior `Map Remote` and `Scripting` both work fine. ## Environment - App version: Proxyman 4.9.0 - macOS version: macOS Ventura 13.4.1 (22F82) Apple M1
Author
Owner

@NghiaTranUIT commented on GitHub (Jul 20, 2023):

Yes, Map Remote doesn't work with the Scripting.

You can use this snippet code to achieve the same thing as Map Remote doesn't with the Scripting.

<!-- gh-comment-id:1643809312 --> @NghiaTranUIT commented on GitHub (Jul 20, 2023): Yes, Map Remote doesn't work with the Scripting. You can use this [snippet code](https://docs.proxyman.io/scripting/snippet-code#change-request-destination-scheme-host-port-path) to achieve the same thing as Map Remote doesn't with the Scripting.
Author
Owner

@4332weizi commented on GitHub (Jul 20, 2023):

We have something like hash check on the request body, the body JSON elements re-ranged after scripting, and 401 returned from the server due to check failed. How to avoid request body JSON element re-range?

<!-- gh-comment-id:1643862197 --> @4332weizi commented on GitHub (Jul 20, 2023): We have something like hash check on the request body, the body JSON elements re-ranged after scripting, and 401 returned from the server due to check failed. How to avoid request body JSON element re-range?
Author
Owner

@NghiaTranUIT commented on GitHub (Jul 21, 2023):

It's a known issue of the Scripting because Swift Dictionary doesn't have the ordered keys.

<!-- gh-comment-id:1644854213 --> @NghiaTranUIT commented on GitHub (Jul 21, 2023): It's a known issue of the Scripting because Swift Dictionary doesn't have the ordered keys.
Author
Owner

@4332weizi commented on GitHub (Jul 21, 2023):

Do you have any solutions?

<!-- gh-comment-id:1644872737 --> @4332weizi commented on GitHub (Jul 21, 2023): Do you have any solutions?
Author
Owner

@NghiaTranUIT commented on GitHub (Jul 21, 2023):

Unfortunately, I haven't found a better solution yet. For now, when modifying the Body of the Request/Response in the Script. It might change the JSON order key.

<!-- gh-comment-id:1644873492 --> @NghiaTranUIT commented on GitHub (Jul 21, 2023): Unfortunately, I haven't found a better solution yet. For now, when modifying the Body of the Request/Response in the Script. It might change the JSON order key.
Author
Owner

@4332weizi commented on GitHub (Jul 21, 2023):

ok, thanks

<!-- gh-comment-id:1644875241 --> @4332weizi commented on GitHub (Jul 21, 2023): ok, thanks
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1712
No description provided.