Skip to content

A lightweight HTTP/HTTPS proxy server written in Rust that safely forwards requests, blocks private network addresses, and logs each request with method, URL, resolved IPs, and status.

License

Notifications You must be signed in to change notification settings

phoenixthrush/rust-cors-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-cors-proxy

A lightweight HTTP/HTTPS proxy server written in Rust that safely forwards requests, blocks private network addresses, and logs each request with method, URL, resolved IPs, and status.

Features

  • Forwards HTTP/HTTPS requests to specified URLs.
  • Prevents SSRF and DNS rebinding attacks.
  • Blocks private, loopback, link-local, multicast, unspecified, and unique-local IPs.
  • Handles CORS preflight requests and adds CORS headers to responses.
  • Logs request method, target URL, resolved IPs, and upstream status.
  • Built using warp, reqwest, tokio, and serde_json.

Usage

Run the proxy locally:

cargo run --release

By default the server listens on:

http://127.0.0.1:8080

To make a request through the proxy:

http://127.0.0.1:8080/https://example.com

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A lightweight HTTP/HTTPS proxy server written in Rust that safely forwards requests, blocks private network addresses, and logs each request with method, URL, resolved IPs, and status.

Resources

License

Stars

Watchers

Forks