ProxymanApp / ProxymanApp/Proxyman

Get flow info from JS Context in the Scripting

Open
#746 1 comment 0 reactions 1 assignee View on GitHub

@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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.