{"id":34547774,"url":"https://github.com/mceck/revpx","last_synced_at":"2026-05-28T17:31:36.185Z","repository":{"id":315491909,"uuid":"1058331155","full_name":"mceck/revpx","owner":"mceck","description":"Lightweight, single-threaded reverse proxy server for development purposes written in C","archived":false,"fork":false,"pushed_at":"2026-05-08T08:28:34.000Z","size":443,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-08T10:31:37.571Z","etag":null,"topics":["c","developer-tools","development","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mceck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T00:28:13.000Z","updated_at":"2026-05-08T08:28:14.000Z","dependencies_parsed_at":"2025-10-22T02:22:47.841Z","dependency_job_id":"8d5d4427-155d-4f35-9ee7-cb8bd1450b6a","html_url":"https://github.com/mceck/revpx","commit_stats":null,"previous_names":["mceck/revpx"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mceck/revpx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceck%2Frevpx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceck%2Frevpx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceck%2Frevpx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceck%2Frevpx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mceck","download_url":"https://codeload.github.com/mceck/revpx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceck%2Frevpx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33619967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"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":["c","developer-tools","development","reverse-proxy"],"created_at":"2025-12-24T07:31:21.014Z","updated_at":"2026-05-28T17:31:36.180Z","avatar_url":"https://github.com/mceck.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# revpx\n`revpx` is a lightweight, single-threaded reverse proxy server for development purposes.\n\nIt supports TLS/SSL termination, SNI (Server Name Indication), and can forward traffic to multiple backend services based on the requested domain name.\n\nIt is designed to be simple to configure and use.\n\n## Usage\n\nYou can generate the SSL certificate files using [mkcert](https://github.com/FiloSottile/mkcert) or openssl.\n\n### 1. Command-Line Arguments\n\nYou can specify domain mappings directly on the command line. Each mapping consists of a domain name, a backend port, a certificate file, and a key file.\n\n```bash\nrevpx [\u003coptions\u003e] [\u003cdomain\u003e \u003cport\u003e \u003ccert_file\u003e \u003ckey_file\u003e ...]\n```\n\n**Options:**\n\n- `--help, -h`: Show the help message.\n- `--file, -f \u003cpath\u003e`: Load configuration from a JSON file.\n- `--port, -p \u003cport\u003e`: The HTTPS port for `revpx` to listen on (default: 443).\n- `--port-plain, -pp \u003cport\u003e`: The HTTP port for `revpx` to listen on (default: 80).\n\n**Example:**\n\n```bash\n# Forward traffic for example.com to localhost:8080\nrevpx example.com 8080 /path/to/cert.pem /path/to/key.pem\n```\n\n### 2. JSON Configuration File\n\nFor more complex setups, you can use a JSON file.\n\n**Example `revpx.example.json`:**\n\n```json\n[\n  {\n    \"domain\": \"example.com\",\n    \"port\": \"8080\",\n    \"cert_file\": \"/path/to/example.com.pem\",\n    \"key_file\": \"/path/to/example.com-key.pem\"\n  },\n  {\n    \"domain\": \"api.example.com\",\n    \"port\": \"8081\",\n    \"cert_file\": \"/path/to/api.example.com.pem\",\n    \"key_file\": \"/path/to/api.example.com-key.pem\"\n  }\n]\n```\n\nRun `revpx` with the file:\n\n```bash\nrevpx --file revpx.example.json\n```\n\n## Building from Source\n\nThis project depends on OpenSSL and libyaml. Make sure you have the development headers installed (e.g. `libssl-dev` and `libyaml-dev` on Debian-based systems).\n\n```bash\n# Compile the project\nmake\n# Install the binary system-wide (optional)\nmake install\n```\n\n### Scripts\n\n- `make`: Build the project\n- `make test`: Build and run the tests\n- `make example`: Build and run with example domain `test.localhost` on port `8080`\n- `make install`: Install the binary system-wide in /usr/local/bin\n\n### C api\n\n```c\n#include \"revpx.h\"\n/**\n * Create a new RevPx instance.\n * @param http_port Port to listen for HTTP (will redirect to HTTPS)\n * @param https_port Port to listen for HTTPS\n */\nRevPx *revpx_create(const char *http_port, const char *https_port);\n/**\n * Free a RevPx instance and all associated resources.\n * @param revpx The RevPx instance to free\n */\nvoid revpx_free(RevPx *revpx);\n/**\n * Add a domain mapping to the reverse proxy.\n * @param revpx The RevPx instance\n * @param domain The domain name to match (e.g. \"example.com\")\n * @param host The backend host to forward to (default: \"127.0.0.1\")\n * @param port The backend port to forward to\n * @param cert The path to the SSL certificate file\n * @param key The path to the SSL key file\n */\nbool revpx_add_domain(RevPx *revpx, const char *domain, const char *host, const char *port, const char *cert, const char *key);\n/**\n * Start the reverse proxy server.\n * Listens on https_port for HTTPS and redirects HTTP traffic from http_port to HTTPS.\n * @param revpx The RevPx instance\n * @return 0 on success, non-zero on failure\n */\nint revpx_run_server(RevPx *revpx);\n/**\n * Set the log level for revpx. Messages with a level lower than this will be ignored.\n * Default level is RP_INFO.\n */\nvoid revpx_set_log_level(int level);\n\n// Example usage\nint main() {\n    RevPx *revpx = revpx_create(\"80\", \"443\");\n    revpx_add_domain(revpx, \"test.localhost\", NULL, \"8080\", \"test.localhost.pem\", \"test.localhost-key.pem\");\n    revpx_run_server(revpx);\n    revpx_free(revpx);\n    return 0;\n}\n```\n\n### Rust bindings\n\n```bash\ncargo add --git https://github.com/mceck/revpx.git\n```\n\n```rust\nlet revpx = revpx::RevPx::default();\nrevpx.add_domains(vec![revpx::DomainConfig {\n    domain: \"test.localhost\".to_string(),\n    host: None,\n    port: \"8080\".to_string(),\n    cert: \"test.localhost.pem\".to_string(),\n    key: \"test.localhost-key.pem\".to_string(),\n}]);\nrevpx.run_server();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmceck%2Frevpx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmceck%2Frevpx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmceck%2Frevpx/lists"}