|
| 1 | +# apxy |
| 2 | + |
| 3 | +A simple, lightweight reverse proxy with URL parameter or header authentication. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🚀 Simple reverse proxy for any web service |
| 8 | +- 🔒 Optional authentication via URL parameter or header |
| 9 | +- 📦 Zero configuration files needed |
| 10 | +- ⚡ Static binary, minimal dependencies |
| 11 | +- 🎯 Cross-platform: ARM64, AMD64 |
| 12 | + |
| 13 | +## Installation |
| 14 | + |
| 15 | +### Via Cargo |
| 16 | + |
| 17 | +```bash |
| 18 | +cargo install apxy |
| 19 | +``` |
| 20 | + |
| 21 | +### Via curl (Quick Install) |
| 22 | + |
| 23 | +```bash |
| 24 | +# Linux/macOS ARM64 |
| 25 | +curl -L https://github.com/YOUR_USERNAME/apxy/releases/latest/download/apxy-aarch64-unknown-linux-musl -o apxy |
| 26 | +chmod +x apxy |
| 27 | +sudo mv apxy /usr/local/bin/ |
| 28 | + |
| 29 | +# Linux AMD64 |
| 30 | +curl -L https://github.com/YOUR_USERNAME/apxy/releases/latest/download/apxy-x86_64-unknown-linux-musl -o apxy |
| 31 | +chmod +x apxy |
| 32 | +sudo mv apxy /usr/local/bin/ |
| 33 | + |
| 34 | +# macOS ARM64 |
| 35 | +curl -L https://github.com/YOUR_USERNAME/apxy/releases/latest/download/apxy-aarch64-apple-darwin -o apxy |
| 36 | +chmod +x apxy |
| 37 | +sudo mv apxy /usr/local/bin/ |
| 38 | + |
| 39 | +# macOS AMD64 |
| 40 | +curl -L https://github.com/YOUR_USERNAME/apxy/releases/latest/download/apxy-x86_64-apple-darwin -o apxy |
| 41 | +chmod +x apxy |
| 42 | +sudo mv apxy /usr/local/bin/ |
| 43 | +``` |
| 44 | + |
| 45 | +## Usage |
| 46 | + |
| 47 | +### Basic Proxy (No Authentication) |
| 48 | + |
| 49 | +```bash |
| 50 | +apxy --target http://localhost:3000 |
| 51 | +``` |
| 52 | + |
| 53 | +This will start a proxy on port 8080 that forwards all requests to `http://localhost:3000`. |
| 54 | + |
| 55 | +### With Authentication |
| 56 | + |
| 57 | +```bash |
| 58 | +apxy --target http://localhost:3000 --auth-token mysecrettoken |
| 59 | +``` |
| 60 | + |
| 61 | +Now clients must provide the token either as: |
| 62 | + |
| 63 | +**URL Parameter:** |
| 64 | + |
| 65 | +```bash |
| 66 | +curl http://localhost:8080/api/data?token=mysecrettoken |
| 67 | +``` |
| 68 | + |
| 69 | +**Header:** |
| 70 | + |
| 71 | +```bash |
| 72 | +curl -H "X-Auth-Token: mysecrettoken" http://localhost:8080/api/data |
| 73 | +``` |
| 74 | + |
| 75 | +### Custom Port |
| 76 | + |
| 77 | +```bash |
| 78 | +apxy --port 9000 --target http://localhost:3000 |
| 79 | +``` |
| 80 | + |
| 81 | +### Full Example |
| 82 | + |
| 83 | +```bash |
| 84 | +apxy \ |
| 85 | + --port 8080 \ |
| 86 | + --target http://localhost:3000 \ |
| 87 | + --auth-token supersecret123 |
| 88 | +``` |
| 89 | + |
| 90 | +## Command Line Options |
| 91 | + |
| 92 | +``` |
| 93 | +Options: |
| 94 | + -p, --port <PORT> Port to listen on [default: 8080] |
| 95 | + -t, --target <TARGET> Target URL to proxy to |
| 96 | + -a, --auth-token <AUTH_TOKEN> Authentication token |
| 97 | + -h, --help Print help |
| 98 | + -V, --version Print version |
| 99 | +``` |
| 100 | + |
| 101 | +## Use Cases |
| 102 | + |
| 103 | +- Add authentication layer to existing services |
| 104 | +- Quick reverse proxy for development |
| 105 | +- Expose local services securely |
| 106 | +- Simple API gateway |
| 107 | + |
| 108 | +## Building from Source |
| 109 | + |
| 110 | +```bash |
| 111 | +git clone https://github.com/YOUR_USERNAME/apxy |
| 112 | +cd apxy |
| 113 | +cargo build --release |
| 114 | +``` |
| 115 | + |
| 116 | +The binary will be at `target/release/apxy`. |
| 117 | + |
| 118 | +## License |
| 119 | + |
| 120 | +MIT |
0 commit comments