Proxyman provides a list of handy built-in add-ons that help you to do many common tasks, such as MD5, SHA1 Hashing, Base64 Encode/Decode, Beautify XML, JSON, ....
Each addon will export the function that you can import by using the require function
To illustrate, Base64.js addon looks like:
1
// Base64.js
2
const Base64 =require('@libs/base64.js');
3
const{ atob }=require("@libs/atob.js");
4
const{ btoa }=require("@libs/btoa.js");
5
​
6
// atob / btoa
7
// They're equivalent with window.atob and window.btoa
8
​
9
exports.atob = atob;
10
exports.btoa = btoa;
11
​
12
// Basic Base64
13
exports.base64Decode=(input)=>{
14
return Base64.decode(input)
15
};
16
​
17
exports.base64Encode=(input)=>{
18
return Base64.encode(input);
19
};
Copied!
Then, you can use it in the script:
1
const{ atob, btoa }=require("@addons/Base64.js")
2
​
3
functiononRequest(context, url, request){
4
​
5
// Encode base64 by using the export function
6
var text =btoa("Hello World");
7
8
console.log(text)
9
// => SGVsbG8gV29ybGQ=
10
}
Copied!
You can find all addons code at ~/Library/Application\ Support/com.proxyman.NSProxy/addons
4. Notes
The require function is not a built-in function from JavascriptCore framework, it's a custom function that Proxyman provides to allows the user to import the addons/libs easily.
Thanks to Ivan Mathy for creating Boop app that facilitates Proxyman's built-in add-ons.
Addons folder will be overridden for every new Proxyman Update. Make sure you don't edit the addon. If need to modify, please copy to the users folder