Skip to content

Latest commit

Β 

History

History
159 lines (106 loc) Β· 6.04 KB

File metadata and controls

159 lines (106 loc) Β· 6.04 KB

Universal Proxy Server (Node.js) πŸš€

GitHub license Β Β  GitHub stars Β Β  GitHub forks Β Β  GitHub watchers Β Β  GitHub followers

A fast, reliable, and no-CORS Node.js proxy server that handles all HTTP methods (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD) and supports both HTTP and HTTPS targets.

Access any URL via a simple path-based proxy β€” perfect for bypassing CORS restrictions, testing APIs, and integrating third-party services seamlessly.


🚩 Features

  • βœ… Supports all HTTP methods (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD)
  • βœ… Handles both HTTP and HTTPS target URLs transparently
  • βœ… No CORS restrictions β€” adds permissive CORS headers automatically
  • βœ… Proxy requests and responses are forwarded exactly as-is
  • βœ… Easy-to-use URL format:

[https://your-proxy.com/https://target-website.com/api](https://your-proxy.com/https://target-website.com/api)

  • βœ… Built with popular, battle-tested libraries: Express and cors-anywhere
  • βœ… Lightweight and fast β€” minimal dependencies for maximum performance
  • βœ… Fully configurable via .env file (e.g., port settings)
  • βœ… Handles CORS preflight OPTIONS requests gracefully
  • βœ… Ready for production deployment on any Node.js hosting platform

πŸ”₯ Why Use This Node.js Proxy Server?

  • Bypass cross-origin resource sharing (CORS) limitations in browsers
  • Bypass Error: Access to fetch at 'https://target-website.com' from origin 'https://your-website.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • Bypass Error: The page at 'https://your-website.com' was loaded over HTTPS, but requested an insecure resource 'http://target-website.com'. This request has been blocked; the content must be served over HTTPS.
  • Quickly test external APIs without setting up complicated proxies
  • Proxy third-party services for web or mobile applications
  • Simple URL pattern for easy integration into your frontend or backend
  • Open-source and MIT licensed β€” customize and extend as you like!

πŸš€ Getting Started

Prerequisites

  • Node.js v14 or higher
  • npm (comes with Node.js)

Installation

  1. Clone the repo or download source code:
git clone https://github.com/mamedul/proxy.git
cd proxy
  1. Install dependencies:
npm install
  1. Create a .env file in the project root to configure the port:
PORT=3000
  1. Start the server:
npm run start

Or, for development with automatic restarts:

npm run dev
  1. Open your browser or API client and use the proxy:
http://localhost:3000/https://example.com/api/data

πŸ“¦ Project Structure

.
β”œβ”€β”€ proxy.js         # Main proxy server script
β”œβ”€β”€ package.json     # Project metadata and dependencies
β”œβ”€β”€ .env             # Environment variables (optional)
└── README.md        # This file

πŸ› οΈ How It Works

  • The proxy listens for incoming requests matching /http(s)://target-url/*.
  • It extracts the target URL from the request path.
  • Uses cors-anywhere to forward the request to the target.
  • Adds permissive CORS headers to all responses.
  • Handles OPTIONS preflight requests immediately with no content.
  • Returns the proxied response back to the client exactly as received.

βš™οΈ Customization

  • Change the port in .env or default to 3000.
  • Add custom headers or logging by editing proxy.js.
  • Secure with authentication or rate limiting in production.

πŸ‘¨β€πŸ’» Author & Hire Me

Hi! I'm Mamedul Islam, a passionate Web Developer who builds modern web applications, E-commerce, PWAs, and fast, static, dynamic, responsive websites. Specializing in WooCommerce, Wordpress, PHP, MySQL, and modern web development. Creating exceptional digital experiences since 2017.

πŸ“¬ Connect With Me:

I'm open for freelance work, Woocommerce, E-commerce, Wordpress, PWA development, speed test apps, Firebase projects, websocket, PHP, MySQL and more. Hire me to bring your ideas to life with clean, modern code!


πŸ“ License

This project is licensed under the MIT License β€” feel free to use, modify, and distribute it freely. ⭐ Don't forget to star this repo if you like it! Β© 2025 Mamedul Islam


Keywords

Node.js proxy server, no CORS proxy, HTTP proxy, HTTPS proxy, API proxy, cross-origin proxy, Express proxy server, cors-anywhere, bypass CORS, open source proxy, Node.js API proxy, universal proxy


Made with ❀️ using Node.js and Express.


⭐ Show Your Support

If you find this extension useful, please consider giving it a star on GitHub! Your support helps motivate further development and improvements.

GitHub stars   If you found this project helpful, give it a ⭐ on GitHub!