Skip to content

A lightweight Node.js proxy server built with Express. Supports request forwarding with Basic Authentication, CORS, JSON parsing, SSL bypassing, and timeout handling. Perfect for testing APIs with authentication or self-signed certificates.

Notifications You must be signed in to change notification settings

RaoulBock/api-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Proxy Server

This project is a simple Node.js proxy server built with Express. It forwards requests to a target HTTPS endpoint with Basic Authentication, while handling CORS, JSON parsing, and SSL bypassing.


πŸš€ Features

  • 🌍 CORS enabled β€” Accepts requests from any origin.

  • πŸ”‘ Basic Authentication β€” Forwards requests with encoded credentials.

  • πŸ”„ Request forwarding β€” Supports all HTTP methods (GET, POST, PUT, DELETE, etc.).

  • πŸ›‘ SSL bypass β€” Useful for self-signed certificates (can be disabled for production).

  • ⚑ Timeout handling β€” Requests automatically timeout after 15 seconds.


πŸ“‚ Project Structure

. β”œβ”€β”€ server.js # Main server file β”œβ”€β”€ package.json └── README.md


πŸ›  Installation

# Clone the repository and install dependencies:

git clone https://github.com/RaoulBock/api-proxy.git
cd proxy-server
npm install

β–Ά Usage

# Start the server:

npm run start

The proxy will run at:

http://localhost:3000


βš™ Configuration

# Inside server.js, update the following values:

const endPointLink = "https://example.com"; // Target server
const port = 7108;                          // Target port

const username = "username";                // Basic Auth username
const password = "password";                // Basic Auth password

⚠ Security Notes

The current setup bypasses SSL certificate validation for HTTPS (rejectUnauthorized: false).

βœ… Useful for testing with self-signed certificates.

❌ Not recommended for production β€” remove or set to true.

Store credentials (username, password) in environment variables instead of hardcoding.


πŸ“œ License

This project is licensed under the MIT License.


About

A lightweight Node.js proxy server built with Express. Supports request forwarding with Basic Authentication, CORS, JSON parsing, SSL bypassing, and timeout handling. Perfect for testing APIs with authentication or self-signed certificates.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published