mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-28 09:35:55 +03:00
[GH-ISSUE #606] Feature Request - Allow Map Local/Remote with Scripting #604
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#604
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mattbenton on GitHub (Aug 30, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/606
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version?
2.5.2 (20520)
macOS Version?
10.15.6 (19G2021)
Feature Request
Allow "Map Local" and "Map Remote" features to work with "Scripting" for the same request.
Current Behavior
When Scripting is enabled for the same request as Map Local, Map Local is ignored.
Expected Behavior
It would be great if Map Local can run first to replace the body of the response.
After this, additional Scripting can be used to further modify the response body or headers.
Example use case
I am trying to use Map Local to map an entire directory to test changes before deploying changes to an app online. Map Local causes all CORS headers to be lost. (Note, the same thing happens in Charles Proxy).
I was hoping I would be able to use the Scripting feature to modify the headers in the response to allow CORS again after the mapping has run.
In Charles Proxy I was able to use the Map Local and "Rewrite" features at the same time to achieve this, though it was quite convoluted to achieve. So far it is impossible to achieve in Proxyman.
By the way, thank you for your work on this awesome tool. I first noticed this tool a month ago and I purchased a license as soon as you released the scripting feature. I believe allowing scripting to work with mapping would make tool even more attractive.
@NghiaTranUIT commented on GitHub (Aug 31, 2020):
@mattbenton Thank you for the detailed report 👍
I understand your situation, I'd suggest:
@mattbenton commented on GitHub (Aug 31, 2020):
Thanks for the quick response!
For simple CORS use cases, adding a response header of
Access-Control-Allow-Origin: *may be sufficient. That is something you could consider for the convenience option you proposed.However, in my specific scenario I will still need to use scripting because our app sends credentials with CORS requests. When credentials (cookies) are sent, the browser does not allow wildcard
*origins to be used and you must reply with a specific origin value, e.g.https://domain1.com. For my use case, I am mapping content that is used across multiple domains so I need to use scripting to dynamically set theAccess-Control-Allow-Originresponse header to the origin/domain making the request.@NghiaTranUIT commented on GitHub (Aug 31, 2020):
Thanks for the hint 🎉. I'm on it now and I will send you a hotfix today 👍
@NghiaTranUIT commented on GitHub (Aug 31, 2020):
@mattbenton Please check out this build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.5.2_Fix_JWT_Addon.Fix+MIME.Support_MapLocal_Scripting.dmg
This build will run the Script Tool after Map Local as you expected 👍
How to setup
@mattbenton commented on GitHub (Aug 31, 2020):
@NghiaTranUIT This is great! Works exactly as I'd hoped.
I also like the
X-Proxyman-*headers. It makes configurations easier to debug.Thanks for the quick turnaround 😄
I'll be suggesting this tool to my colleagues.
@NghiaTranUIT commented on GitHub (Aug 31, 2020):
Glad to hear that 👍 I will roll out the release in the week 🎉
@ldraminski commented on GitHub (May 13, 2022):
@NghiaTranUIT And what about remote map?
@Mausved commented on GitHub (Dec 21, 2023):
@NghiaTranUIT yes, scripting after map remote is still actual 🥲
@NghiaTranUIT commented on GitHub (Dec 21, 2023):
@ldraminski @mattbenton looks like I should support: Map Remote -> Scripting
Let me implement it and send you guys a Beta build 👍
@NghiaTranUIT commented on GitHub (Dec 23, 2023):
@mattbenton @ldraminski can you try this Beta build: https://download.proxyman.io/beta/Proxyman_4.15.0_Map_Remote_Then_Scripting.dmg
Here is how to setup:
Let me know if you have find some bugs/issued 👍
@Mausved commented on GitHub (Dec 26, 2023):
@NghiaTranUIT thank you so much! This is what I need 😃 Everything is okey
@linkjane commented on GitHub (Jan 11, 2024):
@NghiaTranUIT Hi, does the latest Proxyman, which is 4.16.0 also have this function (using map remote with scripting simultaneously)?
@NghiaTranUIT commented on GitHub (Jan 11, 2024):
@linkjane yes, it's included in the latest build v4.16.0