Skip to main content

Addons

Browse the built-in Proxyman Scripting addons for Base64, MD5/SHA hashing, UUID, JWT decode, GZip and more, and import them with require().

1. What's it?​

Proxyman provides handy built-in addons for common tasks, such as MD5 and SHA1 hashing, Base64 encode/decode, and beautifying XML and JSON.

tip

From Proxyman macOS 6.10.0 or later, you can use the native `npm install` to install your 3rd-party libraries. See use-npm-install.md.

2. Built-in Addons​

You can find sample code for all addons at Addons Snippet Code

NameDescription
Base64.jsBase64 encode/decode. Supports native atob/btoa functions
CamelCase.jsConvert text to Camel Case
CryptoJS.jsDES, AES, Rabbit encryption/decryption algorithm. A small wrapper of CryptoJS
DateToTimestamp.jsConvert String Date to Timestamp
DateToUTC.jsConvert String Date to UTC String
DecodeURI.jsDecode percent-encoded String
EncodeURI.jsEncode to percent-encoded String
FormatCSS.jsBeautify CSS String
FormatJSON.jsBeautify JSON String
BeautifyJSON.jsConvert JSON Object to a pretty JSON String
UglifyJSON.jsConvert JSON Object to a compact JSON String
FormatXML.jsBeautify XML String
HelloWorld.jsHello World
Hex2rgb.jsConvert #000000 string to RGB string
JsonToQuery.jsConvert JSON Object to Query String
JSONValidator.jsValidate JSON String
JWTDecode.jsDecode JWT Token
KebabCase.jsConvert to Kebab Case
MD5.jsHash MD5
MinifyCSS.jsMinify CSS String
MinifyJSON.jsMinify JSON String
MinifyXML.jsMinify XML String
QueryToJson.jsConvert Query String to JSON Object
Pako.jsDeflate/Inflate and GZip/UnGZip
SHA1.jsHash SHA1
SHA256.jsHash SHA256
SHA512.jsHash SHA512
SnakeCase.jsConvert to Snake Case
StartCase.jsConvert to Start Case
UUID.jsGenerate Unique UUID-v4 string

3. How to use addons?​

Each addon exports functions that you can import with the require function.

For example, the Base64.js addon looks like this:

// Base64.js
const Base64 = require('@libs/base64.js');
const { atob } = require("@libs/atob.js");
const { btoa } = require("@libs/btoa.js");

// atob / btoa
// They're equivalent with window.atob and window.btoa

exports.atob = atob;
exports.btoa = btoa;

// Basic Base64
exports.base64Decode = (input) => {
return Base64.decode(input)
};

exports.base64Encode = (input) => {
return Base64.encode(input);
};

Then, you can use it in the script:

const { atob, btoa } = require("@addons/Base64.js")

function onRequest(context, url, request) {

// Encode base64 by using the export function
var text = btoa("Hello World");

console.log(text)
// => SGVsbG8gV29ybGQ=
}
info

You can find all addons code at ~/Library/Application\ Support/com.proxyman.NSProxy/addons

4. Notes​

info

The require function is not a built-in function from JavascriptCore framework, it's a custom function that Proxyman provides so you can import addons and libraries easily.

Thanks to Ivan Mathy for creating Boop app that facilitates Proxyman's built-in add-ons.

info

The addons folder is overwritten by every Proxyman update, so don't edit the addons there. To change an addon, copy it to the users folder first. See Write your own Addons.