ProxymanApp / ProxymanApp/Proxyman
Get flow info from JS Context in the Scripting
Open
@NghiaTranUIT is already working on this.
Since Dec 30, 2020.
✅ Done
enhancement
- Dominant language
- No language data
- Stars
- 7k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Description
Description
Currently, we can print out the data of the context object by using console.log(context). For instance,
// context (readonly)
{
"scriptName": "<String> Your Script Name",
"matchingRule": "<String> Your Matching Rule",
"matchingMethod": "<String> Method",
"isEnableOnRequest": "Bool",
"isEnableOnResponse": "Bool",
"filePath": "<String> Script path"
}
However, it lacks the flow data, such as ID, Remote Device IP, Nickname, Client Path, or Client/Remote Address. They're useful if some users need them to write their logic.
For example, change the host if the request comes from a particular remote device.
if (context.remoteDeviceIP == "192.168.0.101") {
request.host = "localhost"
}
Acceptance Criteria
- Add a few useful information of the flow to the context object
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.