Skip to content

iamanishx/rusty-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HTTP Proxy Server

A lightweight Backend-for-Frontend (BFF) proxy server built in Rust, designed to proxy REST, GraphQL and tRPC requests.

Releases Docker Pulls License

πŸ” What is a BFF (Backend-for-Frontend)?

A Backend-for-Frontend (BFF) is a server that sits between your frontend application and backend services. It provides several advantages over reverse proxies, specifically tailored to the frontend's needs.


βœ… Problems Solved

  • CORS Issues
    Eliminates cross-origin resource sharing problems as this will work as backend to backend communication .

  • Performance
    Built in Rust for ultra-high throughput (100k+ requests/second).

  • Security
    Minimal attack surface via a tiny Alpine-based container (0 vulnerabilities).


πŸ“¦ Image Details

  • Latest tag: iamanishx/proxy-xd:latest
  • Version tag: iamanishx/proxy-xd:0.1.0
  • Base image: Alpine 3.19 (minimal footprint)
  • Image size: ~15MB

πŸ› οΈ Development

This project is open source and contributions are welcome!

πŸ”§ Build & Run Locally

Clone the repository

git clone https://github.com/iamanishx/proxy-xd.git
cd proxy-xd

Build in release mode

cargo build --release

Run the server

BACKEND_URL=http://localhost:4000/graphql cargo run

πŸš€ Quick Start

# Pull the Docker image
docker pull iamanishx/proxy-xd:latest

# Run the proxy (replace with your GraphQL/tRPC endpoint)
docker run -p 8080:8080 \
  -e BACKEND_URL=http://your-api-service:4000/graphql \
  -e LISTEN_ADDR=0.0.0.0:8080 \
  iamanishx/proxy-xd:latest

πŸ”§ Configuration

Environment Variable Description Default
BACKEND_URL URL of your API service Required
LISTEN_ADDR Address:port the proxy listens on 0.0.0.0:8080
RUST_LOG Logging level info
MAX_IDLE_CONNS Maximum idle connections 1000
MAX_IDLE_CONNS_PER_HOST Maximum idle connections per host 1000

🐳 Docker Compose Example for your frontend :

version: '3'
services:
  frontend:
    image: your-frontend-app
    ports:
      - "3000:3000"
    environment:
      - API_URL=http://proxy:8080

  proxy:
    image: iamanishx/proxy-xd:latest
    ports:
      - "8080:8080"
    environment:
      - BACKEND_URL=http://api:4000/graphql
      - LISTEN_ADDR=0.0.0.0:8080
      - RUST_LOG=info

  api:
    image: your-api-service
    ports:
      - "4000:4000"

πŸ“„ License MIT

About

Rusty proxy-server πŸ¦β€πŸ”₯

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •