A TypeScript-based HTTP/HTTPS proxy server that forwards requests to a specified URL and logs both requests and responses.
- Forwards HTTP/HTTPS requests to a configurable target URL
- Logs detailed information about requests and responses
- Configurable via environment variables
- Written in TypeScript for better type safety and developer experience
- Clone this repository
- Install dependencies:
npm installCreate a .env file in the root directory (you can copy from .env.example):
PORT=3000
TARGET_URL=https://api.example.com
PORT: The port on which the proxy server will listen (default: 3000)TARGET_URL: The target URL to which requests will be forwarded (required)
npm run devBuild the project:
npm run buildStart the server:
npm start- The proxy server receives an HTTP/HTTPS request
- It forwards the request to the configured target URL
- It logs details about the request (method, path, headers, body)
- It receives the response from the target server
- It logs details about the response (status, headers, data)
- It forwards the response back to the client
ISC