{"id":30619331,"url":"https://github.com/joelp03/rustyx","last_synced_at":"2025-10-05T00:58:52.092Z","repository":{"id":308910379,"uuid":"1032768040","full_name":"Joelp03/rustyx","owner":"Joelp03","description":"Rustyx is a minimal reverse proxy written in Rust, inspired by NGINX.","archived":false,"fork":false,"pushed_at":"2025-08-08T15:03:31.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-30T12:46:51.399Z","etag":null,"topics":["nginx","proxy","proxy-server","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Joelp03.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-05T19:48:46.000Z","updated_at":"2025-08-18T13:52:44.000Z","dependencies_parsed_at":"2025-08-08T17:14:46.097Z","dependency_job_id":"c55b0838-bf41-4ace-ac44-f1199cbb2a85","html_url":"https://github.com/Joelp03/rustyx","commit_stats":null,"previous_names":["joelp03/rustyx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Joelp03/rustyx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joelp03%2Frustyx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joelp03%2Frustyx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joelp03%2Frustyx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joelp03%2Frustyx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joelp03","download_url":"https://codeload.github.com/Joelp03/rustyx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joelp03%2Frustyx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278395909,"owners_count":25979690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx","proxy","proxy-server","reverse-proxy"],"created_at":"2025-08-30T12:46:47.014Z","updated_at":"2025-10-05T00:58:52.075Z","avatar_url":"https://github.com/Joelp03.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦀 Rustyx - Reverse Proxy in Rust\n\nRustyx is a minimal reverse proxy written in Rust, inspired by NGINX. It routes HTTP traffic to multiple backends based on the request path, adds headers like X-Forwarded-For, and uses a simple .toml file for configuration.\n\n## Features\n\n- **Multi-server configuration**: Support for multiple proxy servers with different listening addresses\n- **Path-based routing**: Route requests to different backend servers based on URL paths\n- **Graceful Shutdown**:  Support for a \"graceful shutdown\" signal.\n- **HTTP/HTTPS tunneling**: Full support for CONNECT method and SSL tunneling\n- **Async architecture**: Built on Tokio for high concurrency and performance\n- **Header preservation**: Maintains original header casing and formatting\n- **Connection upgrades**: Support for WebSocket and other protocol upgrades\n\n## Installation\n\n### Prerequisites\n\n- Rust 1.70+ (2024 edition)\n- Cargo\n\n### Build from source\n\n```bash\ngit clone git@github.com:Joelp03/rustyx.git\ncd rustyx\ncargo build --release\n```\n\n## Configuration\n\nRustyx uses a TOML configuration file (`rustyx.toml`) to define proxy servers and routing rules.\n\n### Example Configuration\n\n```toml\n# Primary server\n[[server]]\nlisten = [\"127.0.0.1:8000\"]\nname = \"localhost\"\n\n[[server.location]]\npath = \"/\"\nproxy_pass = \"127.0.0.1:9000\"\n\n[[server.location]]\npath = \"/api\"\nproxy_pass = \"127.0.0.1:9001\"\n\n# Additional server\n[[server]]\nlisten = [\"127.0.0.1:8080\", \"0.0.0.0:8080\"]\nname = \"public\"\n\n# static files\n[[server.location]]\npath = \"/\"\nroot = \"/home/joel/Documents/Development/projects/Rustyx/public\"\n```\n\n### Configuration Options\n\n- `listen`: Array of socket addresses to bind the proxy server\n- `name`: Human-readable name for the server instance\n- `location`: Array of routing rules\n  - `path`: URL path prefix to match\n  - `proxy_pass`: Backend server address to forward requests\n\n## Usage\n\n1. Create your `rustyx.toml` configuration file\n2. Run the proxy server:\n\n```bash\ncargo run\n```\n\nOr with the release build:\n\n```bash\n./target/release/rustyx\n```\n\n## Architecture\n\n### Core Components\n\n- **Master**: Main orchestrator that manages multiple server instances\n- **ProxyService**: HTTP service implementation handling request routing\n- **Config**: TOML-based configuration management\n- **HTTP modules**: Request/response handling and forwarding\n\n### Request Flow\n\n1. Client connects to a configured listening address\n2. Rustyx accepts the connection and spawns a task\n3. Incoming requests are matched against location paths\n4. Requests are forwarded to the appropriate backend server\n5. Responses are proxied back to the client\n\n### Path Matching\n\nThe proxy uses longest-prefix matching for path routing. For example:\n- Request to `/api/users` matches `/api` over `/`\n- Request to `/app/dashboard` matches `/app` if configured\n\n## Development\n\n### Project Structure\n\n```\nRustyx/\n├── Cargo.toml              # Project dependencies and metadata\n├── Cargo.lock              # Dependency lock file\n├── README.md               # Project documentation\n├── rustyx.toml             # Proxy server configuration\n├── .gitignore              # Git ignore rules\n│\n├── src/                    # Source code\n│   ├── main.rs             # Application entry point with graceful shutdown\n│   ├── rustyx.rs           # Master server orchestrator\n│   │\n│   ├── config/             # Configuration management\n│   │   ├── mod.rs          # Module exports\n│   │   └── config.rs       # TOML config parsing and structures\n│   │\n│   ├── handlers/           # Request handlers\n│   │   ├── mod.rs          # Module exports\n│   │   ├── proxy.rs        # Refactored proxy service with routing\n│   │   └── serve_file.rs   # Enhanced static file server with security\n│   │\n│   └── http/               # HTTP utilities and abstractions\n│       ├── mod.rs          # Module exports\n│       ├── body.rs         # HTTP body utilities (full, empty, not_found)\n│       ├── request.rs      # Proxy request wrapper\n│       └── response.rs     # Proxy response wrapper\n│\n```\n\n### Dependencies\n\n- **hyper**: HTTP implementation\n- **hyper-util**: HTTP utilities and runtime\n- **tokio**: Async runtime\n- **serde**: Serialization framework\n- **toml**: TOML parsing\n\n### Running Tests\n\n```bash\ncargo test\n```\n\n### Development Server\n\nFor development with auto-reload:\n\n```bash\ncargo watch -x run\n```\n\n## Performance\n\nRustyx is designed for high performance with:\n- Zero-copy request forwarding where possible\n- Async I/O throughout the stack\n- Efficient connection pooling\n- Minimal memory allocations\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\n[Add your license information here]\n\n## Roadmap\n\n- [ ] HTTPS support\n- [ ] Load balancing support\n- [ ] Hot configuration reload\n- [ ] Health checks for backend servers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelp03%2Frustyx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoelp03%2Frustyx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelp03%2Frustyx/lists"}