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.
-
π 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.
. βββ server.js # Main server file βββ package.json βββ README.md
# Clone the repository and install dependencies:
git clone https://github.com/RaoulBock/api-proxy.git
cd proxy-server
npm install
# Start the server:
npm run start
The proxy will run at:
# 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
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.
This project is licensed under the MIT License.