Skip to content

semanticist21/api-proxy-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Proxy Server

A lightweight API proxy server that forwards requests to target services.

Purpose

Forwards API requests to avoid CORS issues and add authentication layers to third-party APIs.

Headers

The proxy forwards essential headers to support various request types:

const INCLUDE_ON_REQUEST_HEADERS: &[&str] = &[
    "Authorization",
    "Content-Type", 
    "Content-Disposition", 
    "Content-Length",
    "Accept",
    "X-Requested-With"
];

Supported Request Types

  • JSON API calls
  • HTML/plain text responses
  • Multipart form data (file uploads)

Docker Usage

Build

docker build -t api-proxy-server:latest .

Run (foreground)

docker run -p 5055:5055 api-proxy-server:latest

Run (background/daemon)

# Remove existing container if needed
docker rm -f api-proxy-server || true

# Run in background with a container name for easy management
docker run -d --name api-proxy-server -p 5055:5055 api-proxy-server:latest

Example

To proxy a request to JSONPlaceholder:

GET http://localhost:5055/proxy/https://jsonplaceholder.typicode.com/todos/1

Development

cargo run

About

A proxy server running in Docker to bypass CORS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages