mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 00:25:56 +03:00
[GH-ISSUE #611] Scripting persist state between onRequest and onResponse #609
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#609
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 @edba on GitHub (Sep 1, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/611
Originally assigned to: @NghiaTranUIT on GitHub.
In scripting it would be nice to be able to persist state between a request and its response, maybe via the context object or something similar. For example for holding on to the original requests url something like this could work:
this is a really simple example, but it would be useful to be able to reference state in
onResponsethat was derived insideonRequest@NghiaTranUIT commented on GitHub (Sep 1, 2020):
That makes sense. I will find a way to support shared states between the request and response call 👍
@NghiaTranUIT commented on GitHub (Sep 1, 2020):
@edba let check out this build: https://download.proxyman.io/beta/Proxyman_2.5.3_Shared_State.dmg
You can use a global object
sharedStateto share the data between the onRequest/onResponse call. Please bear in mind that this state is reset for each script call 👍@edba commented on GitHub (Sep 1, 2020):
@NghiaTranUIT awesome! yeah this works 👍
@NghiaTranUIT commented on GitHub (Sep 1, 2020):
Glad to hear that work for you 🎉 😄
@NghiaTranUIT commented on GitHub (Sep 10, 2020):
I officially released the sharedState for the Scripting in Proxyman 2.6.0. Please check it out and the Doc: https://docs.proxyman.io/scripting/environment-variables