mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 00:55:57 +03:00
[GH-ISSUE #1275] scripting timeout #1268
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#1268
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 @webuniverseio on GitHub (Jun 28, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1275
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? (Ex. Proxyman 1.4.3)
3.6.0
macOS Version? (Ex. mac 10.14)
12.3.1
Steps to reproduce
Try scripting with this code
Expected behavior
Expect hanging request for 10s before other scripting logic will execute. Instead getting scripting error (I know JS engine doesn't support Promise, but then at least some js cases are not possible to implement)
Screenshots (optional)
@webuniverseio commented on GitHub (Jun 28, 2022):
As a hack workaround I'm thinking of making a request to api which supports timeouts via parameters. Very hacky :D. It would be good to have a built in method like sleep(ms)
@NghiaTranUIT commented on GitHub (Jun 29, 2022):
You get the error because
setTimeoutisn't implemented in the JavascriptCore. Meanwhile, it supports Promise.For the
$httpfunc, the timeout at 10 seconds. Thus, it will work withawait $http.get('http://httpbin.org/delay/10'), but you get timeout withawait $http.get('http://httpbin.org/delay/15')If you'd like to delay the request/response, you can simply use the
sleep()functionRef: https://docs.proxyman.io/scripting/snippet-code#response-delay-with-sleep-function
If it's not what you're looking for, please let me know 😄
I guess I should implement the
setTimeoutfunction soon 👍@webuniverseio commented on GitHub (Jun 29, 2022):
Thanks, my bad, I need to read the manual 😅