Skip to main content

Installation

This guide will walk you through setting up bet365-re-js on your system. The project requires both Python and Node.js environments.

Prerequisites

Before you begin, ensure you have the following tools installed:

Python Environment Manager

miniforge or miniconda for managing Python environments

Node.js Version Manager

nvm (Node Version Manager) for managing Node.js versions
Using miniforge/miniconda for a fresh Python environment is recommended. This allows you to experiment with dependencies and delete the environment without affecting your system Python installation.

Step 1: Python Environment Setup

Create a New Conda Environment

The project requires Python 3.12. You can create a new conda environment with the provided script:
source new-conda-environment.sh
This script does the following:
  • Creates a new conda environment named bet365-re-js
  • Installs Python 3.12
  • Activates the environment
  • Installs pip dependencies automatically
#!/usr/bin/env bash

conda create -n bet365-re-js python=3.12 && \
conda activate bet365-re-js

./python-dependencies.sh

Install Python Dependencies Manually (Optional)

If you skipped creating a new conda environment or want to use your existing Python environment, install dependencies manually:
./python-dependencies.sh
The script installs dependencies from mitmproxy/src/python/requirements-test.txt, which includes:Core Dependencies:
  • mitmproxy - For intercepting and modifying HTTP/HTTPS traffic
  • jsbeautifier - For formatting JavaScript output
  • rjsmin - For minifying JavaScript code
Testing Dependencies:
  • playwright - For browser automation testing
  • pytest - Testing framework
  • pytest-playwright - Playwright integration for pytest

Step 2: Node.js Setup

Verify Node.js Installation

Check if Node.js is already installed:
node --version

Install Node.js with nvm

If Node.js is not installed, use nvm to install the version specified in .nvmrc:
nvm install $(cat .nvmrc) && nvm use
The project uses Node.js v22.15.0 (specified in .nvmrc).
At the time of project creation, the latest LTS version was v22.13.0, but the project has been updated to v22.15.0.

Update npm (Optional)

If you’re using an older version of npm, update it to the latest version:
npm update -g npm

Step 3: Install Node.js Dependencies

Install all required npm packages:
npm install
Production Dependencies:
{
  "escodegen": "^2.1.0",
  "glob": "^11.0.0",
  "jscodeshift": "^0.16.1",
  "npm": "^10.8.2",
  "recast": "^0.23.9",
  "uuid": "^11.0.4"
}
Development Dependencies:
{
  "@babel/core": "^7.26.0",
  "@babel/preset-env": "^7.26.0",
  "babel-jest": "^29.7.0",
  "eslint-plugin-jest": "^28.9.0",
  "jest": "^29.7.0"
}
Key packages:
  • jscodeshift - AST transformation framework
  • recast - JavaScript parser and code generator preserving formatting
  • escodegen - ECMAScript code generator
  • jest - Testing framework for JavaScript transformations

Step 4: Verify Installation

Verify that everything is set up correctly:
1

Check Python Environment

python --version
# Should output: Python 3.12.x
2

Check Node.js

node --version
# Should output: v22.15.0
3

Verify mitmproxy

mitmproxy --version
# Should output mitmproxy version information
4

Run Tests (Optional)

npm test
# Runs Jest test suite for AST transformations

Troubleshooting

Make sure you have pip installed and updated:
conda install pip
pip install --upgrade pip
Then try installing dependencies again:
./python-dependencies.sh
Ensure you’re using the correct Node.js version:
nvm use
If you get an error, install the version first:
nvm install 22.15.0
nvm use 22.15.0
Make sure your conda environment is activated:
conda activate bet365-re-js
If still not found, reinstall dependencies:
pip install -r mitmproxy/src/python/requirements-test.txt
Make the scripts executable:
chmod +x new-conda-environment.sh
chmod +x python-dependencies.sh
chmod +x mitmproxy.sh

Next Steps

Once installation is complete, proceed to the Quickstart guide to start intercepting and deobfuscating JavaScript!

Quickstart Guide

Learn how to start mitmproxy, configure your browser, and see deobfuscated JavaScript in action

Build docs developers (and LLMs) love