English | Português
A robust and configurable HTTP proxy server developed in TypeScript, featuring authentication, host access control, and logging. Ideal for scenarios such as Discord bots, data scraping, and traffic control.
- 🔐 Basic authentication via config.toml
- 🌐 Host access control
- 📄 Logging with Winston
- ⚙️ All configuration is loaded exclusively from config.toml
- 🧪 Modular and extensible structure
Note:
All configuration is centralized in theconfig.tomlfile and loaded through thesrc/config/module. No environment variables or other config files are used.
- 
Clone the repository: git clone https://github.com/HCDevWorks/http-proxy.git cd http-proxy
- 
Install the dependencies: pnpm install 
- 
Configure the config.tomlfile (seeconfig.example.tomlfor an example):[server] port = 8888 [logging] enableLogs = true enableErrorLogs = false [auth] username = "your_username" password = "your_password" [allowed_hosts] hosts = ["google.com", "youtube.com"] # Or to allow all hosts: # hosts = "*" 
Note:
To allow connections from any host, sethosts = "*"in[allowed_hosts].
To restrict, use a list of domains, likehosts = ["google.com", "youtube.com"].
Start the proxy server with:
pnpm build # build the server
pnpm start # start the serverThe server will listen on the port defined in config.toml (default: 8888).
See how to create a systemd service to run the proxy automatically on Linux in docs/LINUX-SERVICE.md.
http-proxy/
├── src/
│   ├── config/
│   │   ├── index.ts      # Loads and exports the validated config object
│   │   ├── loader.ts     # Loads and parses config.toml, validates with Zod
│   │   └── schema.ts     # Zod schema and types for config
│   ├── core/
│   │   ├── logger.ts     # Winston logger configuration
│   │   └── server.ts     # Main proxy server logic
│   └── index.ts          # Entry point
├── tests/
│   ├── testProxy.ts
│   └── testProxyBenchmark.ts
├── config.toml
├── config.example.toml
├── logs/
│   └── proxy.log
├── package.json
├── pnpm-lock.yaml
├── tsconfig.json
└── docs/
    ├── LINUX-SERVICE.md
    └── pt-br/
        ├── LINUX-SERVICE.md
        └── README.md
Contributions are welcome! Please read our Code of Conduct and Contributing Guidelines before opening issues or pull requests.
We also provide templates to help you:
This project is licensed under the MIT License.
