Skip to content
/ rcp Public

RCP (Rust CORS Proxy) is a lightweight HTTP proxy server implemented in Rust, enabling Cross-Origin Resource Sharing (CORS) for web applications with ease.

License

Notifications You must be signed in to change notification settings

f-str/rcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RCP - Rust CORS Proxy

RCP (Rust CORS Proxy) is a lightweight HTTP proxy server implemented in Rust that enables Cross-Origin Resource Sharing (CORS) for web applications. It allows you to make cross-origin requests to APIs or resources that would otherwise be blocked due to browser security policies.

Features

  • Enables CORS for web applications by acting as a proxy server.
  • Supports HTTP GET, POST, PUT, DELETE, and OPTIONS methods.
  • Automatically adds appropriate CORS headers to the proxied responses.
  • Provides a simple and straightforward implementation.

Installation

  1. Install Rust on your machine.
  2. Clone this repository.
git clone https://github.com/f-str/rcp.git
  1. Build the project.
cd rcp
cargo build --release

Usage

  1. Start the RCP server.
cargo run --release
  1. RCP will start listening on 0.0.0.0:8080 by default.

  2. Make requests to the RCP server by replacing the original URL with the RCP URL.

http://localhost:8080/original-url

For example, to proxy https://api.example.com/data, you would make a request to http://localhost:8080/https://api.example.com/data.

  1. RCP will forward the request to the original URL and return the response with the appropriate CORS headers.

Configuration

RCP can be configured using environment variables:

  • LOGGING_ENABLED: Set to "true" to enable logging (default: false).
  • PORT: Set the port that RCP listens on (default: 8080).
  • ADDRESS: Set the address that RCP listens on (default: 0.0.0.0).

Contributing

Contributions to RCP are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request. Make sure to follow the existing code style and provide clear commit messages.

License

This project is licensed under the MIT License.

About

RCP (Rust CORS Proxy) is a lightweight HTTP proxy server implemented in Rust, enabling Cross-Origin Resource Sharing (CORS) for web applications with ease.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published