Skip to content

talkincode/apxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apxy

A simple, lightweight reverse proxy with URL parameter or header authentication.

Features

  • 🚀 Simple reverse proxy for any web service
  • 🔒 Optional authentication via URL parameter or header
  • 📦 Zero configuration files needed
  • ⚡ Static binary, minimal dependencies
  • 🎯 Cross-platform: ARM64, AMD64

Installation

Quick Install (Recommended)

Install with a single command using our installation script:

curl -fsSL https://raw.githubusercontent.com/talkincode/apxy/main/install.sh | bash

This will automatically detect your OS and architecture, download the latest release, and install it to /usr/local/bin.

Via Cargo

cargo install apxy

Manual Installation via curl

# Linux/macOS ARM64
curl -L https://github.com/talkincode/apxy/releases/latest/download/apxy-aarch64-unknown-linux-musl -o apxy
chmod +x apxy
sudo mv apxy /usr/local/bin/

# Linux AMD64
curl -L https://github.com/talkincode/apxy/releases/latest/download/apxy-x86_64-unknown-linux-musl -o apxy
chmod +x apxy
sudo mv apxy /usr/local/bin/

# macOS ARM64
curl -L https://github.com/talkincode/apxy/releases/latest/download/apxy-aarch64-apple-darwin -o apxy
chmod +x apxy
sudo mv apxy /usr/local/bin/

# macOS AMD64
curl -L https://github.com/talkincode/apxy/releases/latest/download/apxy-x86_64-apple-darwin -o apxy
chmod +x apxy
sudo mv apxy /usr/local/bin/

Usage

Basic Proxy (No Authentication)

# Full URL format
apxy --target http://localhost:3000

# Shorthand: just port number
apxy --target 3000

# Shorthand: with colon
apxy --target :3000

# Shorthand: localhost with port
apxy --target localhost:3000

All the above commands will proxy to http://localhost:3000. This will start a proxy on port 8080 that forwards all requests.

With Authentication

apxy --target http://localhost:3000 --auth-token mysecrettoken

Now clients must provide the token either as:

URL Parameter:

curl http://localhost:8080/api/data?token=mysecrettoken

Header:

curl -H "X-Auth-Token: mysecrettoken" http://localhost:8080/api/data

Custom Port

apxy --port 9000 --target http://localhost:3000

Full Example

apxy \
  --port 8080 \
  --target http://localhost:3000 \
  --auth-token supersecret123

Command Line Options

Options:
  -p, --port <PORT>              Port to listen on [default: 8080]
  -t, --target <TARGET>          Target URL to proxy to (supports shorthand: port, :port, localhost:port, or full URL)
  -a, --auth-token <AUTH_TOKEN>  Authentication token
  -h, --help                     Print help
  -V, --version                  Print version

Target Format Examples

The --target parameter supports various formats for convenience:

  • Port only: 3000http://localhost:3000
  • With colon: :3000http://localhost:3000
  • Host:port: localhost:3000http://localhost:3000
  • Full URL: http://localhost:3000http://localhost:3000
  • Remote: example.com:8080http://example.com:8080
  • HTTPS: https://api.example.comhttps://api.example.com

Use Cases

  • Add authentication layer to existing services
  • Quick reverse proxy for development
  • Expose local services securely
  • Simple API gateway

Building from Source

git clone https://github.com/talkincode/apxy
cd apxy
cargo build --release

The binary will be at target/release/apxy.

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published