Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ revamp Public

A Node.js SOCKS5/HTTP proxy that intercepts web traffic and transforms modern JavaScript, CSS, and HTML for legacy browsers like Safari 9 on iPad 2, iPod Touch, and iPad Mini (iOS 9+).

License

Notifications You must be signed in to change notification settings

lifeart/revamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Re:Vamp

CI Docker codecov License: MIT Node.js Version TypeScript Docker Image

ReVamp logo

Legacy Browser Compatibility Proxy β€” Transform modern web content for older devices like iPads and iPods running iOS 9+.

Give your old iPad 2, iPad Mini, or iPod Touch a second life by making modern websites work again!

✨ Features

Core Proxy Features

  • πŸ”§ JavaScript Transpilation β€” Babel transforms modern JS (optional chaining, nullish coalescing, async/await) to ES5/ES6
  • 🎨 CSS Transformation β€” PostCSS adds vendor prefixes and transforms modern CSS features
  • πŸ“„ HTML Modification β€” Injects polyfills and can remove ads/tracking scripts
  • πŸ”’ HTTPS Interception β€” Transparent SSL/TLS interception with auto-generated certificates
  • 🧦 SOCKS5 Proxy β€” Device-wide traffic routing (recommended for iOS)
  • 🌐 HTTP Proxy β€” Alternative proxy method
  • πŸ“¦ Smart Caching β€” Memory + disk caching for faster repeat visits
  • 🎭 User-Agent Spoofing β€” Bypass browser detection (optional)
  • 🚫 Ad & Tracking Removal β€” Block common ad networks and trackers
  • πŸ“± Easy Setup β€” Built-in captive portal for certificate installation

Polyfills for Legacy Browsers

  • Promise.finally, Promise.allSettled β€” Modern Promise methods
  • fetch API β€” Full fetch/Headers/Response polyfill
  • IntersectionObserver β€” Lazy loading support
  • ResizeObserver β€” Element resize detection
  • MutationObserver β€” DOM mutation detection (enhanced)
  • WeakMap/WeakSet β€” Weak reference collections
  • Web Components β€” Custom Elements v1 and basic Shadow DOM
  • Intl API β€” Basic DateTimeFormat and NumberFormat
  • Service Worker Bypass β€” Disables SW registration for compatibility
  • Lazy Loading β€” Polyfill for loading="lazy" attribute

CSS Enhancements

  • CSS Grid β†’ Flexbox Fallback β€” Auto-generate flexbox fallbacks for CSS Grid
  • Dark Mode Stripping β€” Remove prefers-color-scheme media queries
  • Vendor Prefixes β€” Automatic -webkit- prefixes for Safari 9

DevOps & Monitoring

  • πŸ“Š Metrics Dashboard β€” Real-time web UI at /__revamp__/metrics
  • 🐳 Docker Support β€” Production and development Dockerfiles
  • πŸ“‹ PAC File Generation β€” Auto-generate proxy config files
  • βš™οΈ External Config β€” JSON config for blocked domains

Performance Optimizations

  • 🧡 Babel Worker Pool β€” JavaScript transforms run in parallel worker threads via tinypool
  • ⚑ Async Compression β€” Non-blocking gzip compression/decompression
  • 🎚️ Configurable Compression β€” Adjustable gzip level (1-9) for speed vs size tradeoff
  • πŸ“ˆ Up to 9x speedup β€” Parallel compression achieves significant performance gains

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/lifeart/revamp.git
cd revamp

# Install dependencies (pnpm recommended)
pnpm install

# Start the proxy
pnpm start

# Or in development mode (auto-reload)
pnpm dev

Docker Installation

# Build and run with Docker
docker build -t revamp .
docker run -p 1080:1080 -p 8080:8080 -p 8888:8888 revamp

# Or use Docker Compose
docker-compose up -d

# Development mode with hot-reload
docker-compose --profile dev up revamp-dev

Device Setup

  1. Start Revamp on your computer
  2. Open the setup page on your legacy device:
    • Navigate to http://YOUR_COMPUTER_IP:8888
  3. Install the certificate and enable trust (see detailed instructions below)
  4. Configure proxy in Wi-Fi settings

πŸ“± Detailed Setup

Installing the CA Certificate

When you start Revamp, a CA certificate is generated at .revamp-certs/ca.crt.

On iOS:

  1. Open http://YOUR_COMPUTER_IP:8888 in Safari
  2. Tap "Download Certificate"
  3. Go to Settings β†’ General β†’ VPN & Device Management
  4. Install the downloaded profile
  5. Go to Settings β†’ General β†’ About β†’ Certificate Trust Settings
  6. Enable full trust for "Revamp Proxy CA"

On macOS:

  1. Open the .revamp-certs/ca.crt file
  2. Add to Keychain Access
  3. Find "Revamp Proxy CA", double-click, expand Trust
  4. Set "When using this certificate" to "Always Trust"

Configuring the Proxy

SOCKS5 (Recommended for iOS):

  • Settings β†’ Wi-Fi β†’ [Your Network] β†’ Configure Proxy
  • Select Manual
  • Server: YOUR_COMPUTER_IP
  • Port: 1080

HTTP Proxy (Alternative):

  • Server: YOUR_COMPUTER_IP
  • Port: 8080

βš™οΈ Configuration

Edit src/config/index.ts or pass options when creating the server:

import { createRevampServer } from "revamp";

const server = createRevampServer({
  // Server ports
  socks5Port: 1080,
  httpProxyPort: 8080,
  captivePortalPort: 8888,

  // Target browsers (Browserslist format)
  targets: ["safari 9", "ios 9"],

  // Feature toggles
  transformJs: true, // Babel transpilation
  transformCss: true, // PostCSS transformation
  transformHtml: true, // HTML polyfill injection
  removeAds: true, // Block ad domains
  removeTracking: true, // Block tracking domains
  injectPolyfills: true, // Add polyfills for missing APIs
  spoofUserAgent: true, // Send modern User-Agent to servers
  spoofUserAgentInJs: true, // Override navigator.userAgent

  // Cache settings
  cacheEnabled: true,
  cacheTTL: 3600, // seconds

  // Performance tuning
  compressionLevel: 4, // gzip level 1-9 (1=fastest, 9=smallest)
});

server.start();

Runtime Configuration API

You can change settings at runtime via the config API:

// From your legacy device's browser console or code:
fetch("http://any-proxied-site/__revamp__/config", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    transformJs: false, // Disable JS transformation
    removeAds: false, // Allow ads
  }),
});

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Legacy Device  │────▢│  SOCKS5 Proxy   │────▢│  Target Server  β”‚
β”‚   (iOS 9+)      β”‚     β”‚   (port 1080)   β”‚     β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚         Transformation Pipeline         β”‚
                        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                        β”‚  1. Intercept request                   β”‚
                        β”‚  2. Check cache                         β”‚
                        β”‚  3. Fetch from origin server            β”‚
                        β”‚  4. Transform content:                  β”‚
                        β”‚     β€’ JS β†’ Babel (ES5/ES6)              β”‚
                        β”‚     β€’ CSS β†’ PostCSS (prefixes)          β”‚
                        β”‚     β€’ HTML β†’ Cheerio (polyfills)        β”‚
                        β”‚  5. Cache transformed result            β”‚
                        β”‚  6. Return to client                    β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

src/
β”œβ”€β”€ index.ts              # Main entry point
β”œβ”€β”€ config/               # Configuration management
β”‚   β”œβ”€β”€ index.ts          # Config defaults and getters
β”‚   └── client-options.ts # Single source of truth for client options
β”œβ”€β”€ proxy/                # Proxy servers
β”‚   β”œβ”€β”€ http-proxy.ts     # HTTP/HTTPS proxy
β”‚   β”œβ”€β”€ socks5.ts         # SOCKS5 proxy
β”‚   β”œβ”€β”€ socks5-protocol.ts # SOCKS5 protocol implementation
β”‚   β”œβ”€β”€ http-client.ts    # HTTP request utilities
β”‚   β”œβ”€β”€ shared.ts         # Shared utilities
β”‚   β”œβ”€β”€ revamp-api.ts     # API endpoint handler
β”‚   └── types.ts          # Type definitions
β”œβ”€β”€ transformers/         # Content transformation
β”‚   β”œβ”€β”€ js.ts             # JavaScript (Babel worker pool)
β”‚   β”œβ”€β”€ js-worker.ts      # Babel worker thread
β”‚   β”œβ”€β”€ css.ts            # CSS (PostCSS)
β”‚   β”œβ”€β”€ css-grid-fallback.ts # CSS Grid β†’ Flexbox
β”‚   β”œβ”€β”€ dark-mode-strip.ts # Dark mode CSS removal
β”‚   β”œβ”€β”€ html.ts           # HTML (Cheerio)
β”‚   β”œβ”€β”€ image.ts          # Image optimization
β”‚   └── polyfills/        # 25+ polyfill scripts
β”œβ”€β”€ metrics/              # Metrics collection
β”œβ”€β”€ pac/                  # PAC file generation
β”œβ”€β”€ cache/                # Caching system
β”œβ”€β”€ certs/                # Certificate generation
β”œβ”€β”€ portal/               # Captive portal
└── benchmarks/           # Performance benchmarks

tests/                    # E2E tests (Playwright)
config/                   # External configuration (blocked domains)

🌐 API Endpoints

All API endpoints are available on any proxied domain at /__revamp__/*:

Endpoint Description
/__revamp__/config GET/POST/DELETE proxy configuration
/__revamp__/metrics HTML metrics dashboard
/__revamp__/metrics/json JSON metrics data
/__revamp__/pac/socks5 SOCKS5 PAC file download
/__revamp__/pac/http HTTP PAC file download
/__revamp__/pac/combined Combined PAC file download

Metrics Dashboard

Access real-time statistics at http://any-proxied-site/__revamp__/metrics:

  • Uptime and connection stats
  • Cache hit rate
  • Transformation counts (JS/CSS/HTML/Images)
  • Bandwidth usage
  • Blocked requests count

PAC Files

PAC (Proxy Auto-Config) files make device setup easier:

# Get PAC file URL for iOS configuration
http://YOUR_COMPUTER_IP:8888/__revamp__/pac/socks5

Configure iOS: Settings β†’ Wi-Fi β†’ [Network] β†’ Configure Proxy β†’ Automatic β†’ Enter PAC URL

πŸ§ͺ Testing

# Unit tests
pnpm test:unit        # Watch mode
pnpm test:unit:run    # Single run

# E2E tests
pnpm test             # Run all
pnpm test:headed      # With browser
pnpm test:ui          # Interactive mode

# Type checking
pnpm typecheck

# Performance benchmarks
pnpm build && pnpm tsx src/benchmarks/parallel-transform.ts

Benchmark Results

On a typical machine (8-core CPU), parallel performance improvements:

Operation Sequential Parallel Speedup
JS Transform ~42ms ~40ms 1.05x
CSS Transform ~5ms ~4ms 1.37x
Gzip Compress ~0.4ms ~0.04ms 9.36x
Gzip Decompress ~0.06ms ~0.04ms 1.52x

The worker pool's main benefit is keeping the main event loop responsive during heavy concurrent load, preventing request queuing and latency spikes.

πŸ”§ Troubleshooting

Certificate Issues

"Not Trusted" warning:

  • Ensure you've enabled trust in Settings β†’ General β†’ About β†’ Certificate Trust Settings
  • Try regenerating certificates: delete .revamp-certs/ and restart

Certificate won't install:

  • Make sure you're using Safari (not Chrome) on iOS
  • The certificate must be downloaded via HTTP, not HTTPS

Connection Issues

Can't connect to proxy:

  • Verify your computer's IP address
  • Check firewall settings (ports 1080, 8080, 8888)
  • Ensure both devices are on the same network

Websites not loading:

  • Check the Revamp console for errors
  • Some sites may have additional protections
  • Try disabling transformations to isolate issues

Performance Issues

Slow page loads:

  • Enable caching if disabled
  • Consider disabling transformations for specific sites
  • Check available disk space for cache

πŸ“¦ Dependencies

Package Purpose
@babel/core JavaScript transpilation
postcss CSS transformation
cheerio HTML parsing/manipulation
node-forge Certificate generation
sharp Image optimization
tinypool Worker thread pool for parallel transforms

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

πŸ“„ License

MIT Β© Alex Kanunnikov

πŸ™ Acknowledgments

  • Babel team for the amazing transpiler
  • PostCSS team for CSS tooling
  • node-forge for certificate generation
  • All contributors and users!

Give your old devices new life! πŸ”„

About

A Node.js SOCKS5/HTTP proxy that intercepts web traffic and transforms modern JavaScript, CSS, and HTML for legacy browsers like Safari 9 on iPad 2, iPod Touch, and iPad Mini (iOS 9+).

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages