Created
January 12, 2026 02:31
-
-
Save squeaky-nose/105629e4efb03b23132c547c6a41ad40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get latest version of this script from: | |
| // https://gist.github.com/squeaky-nose/105629e4efb03b23132c547c6a41ad40 | |
| // | |
| // Change log: | |
| // 12/01/25 - Initial script as per ProxyMan 6.3.0 | |
| // | |
| // To Use in Proxyman: | |
| // 1. Scripting -> 'Script List...' | |
| // 2. Enable scripting and add a script ('+' button at bottom) | |
| // 3. Fill in:... | |
| // Name: `Celebrus Debug` | |
| // URL: https://celebrus.*.com/*/v4/postEvent/ | |
| // POST, Use Wildcard | |
| // 4. Paste this script. | |
| // 5. Add a customPreviewerTab on the request called `Celebrus`... https://docs.proxyman.com/basic-features/custom-previewer-tab | |
| async function onRequest(context, url, request) { | |
| let asciiArray = request.body; | |
| if (Array.isArray(asciiArray)) { | |
| // 1. Convert ASCII codes to a readable string | |
| // This turns [122, 61, 110] into "z=n" | |
| let decodedString = String.fromCharCode.apply(null, asciiArray); | |
| console.log("--- Decoded Celebrus Body ---"); | |
| console.log(decodedString); | |
| // 2. Parse the individual parameters (z and y) | |
| // Since it's a string like "z=123&y=456", we can split it | |
| let params = {}; | |
| decodedString.split('&').forEach(part => { | |
| let [key, value] = part.split('='); | |
| params[key] = value; | |
| }); | |
| console.log("Found params:", Object.keys(params)); | |
| request.headers["X-Celebrus-Y"] = params["y"]; | |
| request.headers["X-Celebrus-Z"] = params["z"]; | |
| let zParts = params["z"].split('_') | |
| let yParts = params["y"].split('!') | |
| const obj = { | |
| "session": { | |
| "raw": params["z"], | |
| "something": zParts[0], | |
| "realTimeId": zParts[1], | |
| "sessionKey": zParts[2] | |
| }, | |
| "payload": { | |
| "raw": params["y"], | |
| "parts": yParts | |
| } | |
| }; | |
| request.customPreviewerTabs["Celebrus"] = JSON.stringify(obj, null, 2); | |
| } | |
| return request; | |
| } | |
| /// This func is called if the Response Checkbox is Enabled. You can modify the Response Data here before it goes to the client | |
| /// e.g. Add/Update/Remove: headers, statusCode, comment, color and body (json, plain-text, Uint8Array for Binary Body) | |
| /// | |
| async function onResponse(context, url, request, response) { | |
| // console.log(response); | |
| // Update or Add new headers | |
| // response.headers["Content-Type"] = "application/json"; | |
| // Update status Code | |
| // response.statusCode = 500; | |
| // Update Body | |
| // var body = response.body; | |
| // body["new-key"] = "Proxyman"; | |
| // response.body = body; | |
| // Or map a local file as a body | |
| // response.bodyFilePath = "~/Desktop/myfile.json" | |
| // Done | |
| return response; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment