[GH-ISSUE #526] Enhance Scripting Context with Built-in Utilities (Buffer, TextEncoder, TextDecoder, btoa, atob) #525

Open
opened 2026-03-03 19:51:07 +03:00 by kerem · 0 comments
Owner

Originally created by @kics223w1 on GitHub (Aug 1, 2025).
Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/526

Originally assigned to: @kics223w1 on GitHub.

Description

The Scripting Context in Proxyman for Windows/Linux can be significantly enhanced.
By providing built-in support for commonly used utilities such as Buffer, TextEncoder, TextDecoder, btoa, and atob, users can leverage these directly without needing to import external libraries or write additional helper functions.

Example Code

async function onRequest(context, url, request) {
  const rawBytes = new Uint8Array([
    0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xd7, 0xff,
  ]);

  // Convert raw bytes into a Buffer
  const rawBuffer = Buffer.from(rawBytes);

  // Assign the buffer as the request body
  request.body = rawBuffer;

  return request;
}

Acceptance Criteria

  • Add Buffer, TextEncoder, TextDecoder, btoa, and atob to the Scripting Context.
  • Ensure the example script above runs successfully without requiring external imports.
Originally created by @kics223w1 on GitHub (Aug 1, 2025). Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/526 Originally assigned to: @kics223w1 on GitHub. ## Description The Scripting Context in **Proxyman for Windows/Linux** can be significantly enhanced. By providing built-in support for commonly used utilities such as `Buffer`, `TextEncoder`, `TextDecoder`, `btoa`, and `atob`, users can leverage these directly without needing to import external libraries or write additional helper functions. ## Example Code ```js async function onRequest(context, url, request) { const rawBytes = new Uint8Array([ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xd7, 0xff, ]); // Convert raw bytes into a Buffer const rawBuffer = Buffer.from(rawBytes); // Assign the buffer as the request body request.body = rawBuffer; return request; } ``` ## Acceptance Criteria - Add `Buffer`, `TextEncoder`, `TextDecoder`, `btoa`, and `atob` to the Scripting Context. - Ensure the example script above runs successfully without requiring external imports.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxyman-windows-linux#525
No description provided.