{"id":19285784,"url":"https://github.com/zhu327/pingsix","last_synced_at":"2025-04-12T01:35:08.551Z","repository":{"id":261726558,"uuid":"885153300","full_name":"zhu327/pingsix","owner":"zhu327","description":"PingSIX is an API gateway project based on Cloudflare Pingora, with a configuration similar to APISIX.","archived":false,"fork":false,"pushed_at":"2025-03-10T01:56:55.000Z","size":149,"stargazers_count":34,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T21:15:19.653Z","etag":null,"topics":["api-gateway","pingora","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhu327.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-11-08T03:50:00.000Z","updated_at":"2025-03-22T23:16:20.000Z","dependencies_parsed_at":"2024-11-08T04:33:08.461Z","dependency_job_id":"e08b6578-8d52-4296-a856-8bc7b6c1cc56","html_url":"https://github.com/zhu327/pingsix","commit_stats":null,"previous_names":["zhu327/pingsix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhu327%2Fpingsix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhu327%2Fpingsix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhu327%2Fpingsix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhu327%2Fpingsix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhu327","download_url":"https://codeload.github.com/zhu327/pingsix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248504607,"owners_count":21115179,"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","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":["api-gateway","pingora","reverse-proxy"],"created_at":"2024-11-09T21:46:40.942Z","updated_at":"2025-04-12T01:35:08.546Z","avatar_url":"https://github.com/zhu327.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PingSIX\n\nPingSIX is a high-performance and scalable API gateway designed for modern cloud-native environments. Inspired by Cloudflare Pingora and APISIX, PingSIX combines Rust's flexibility, robustness, and efficiency to provide powerful reverse proxy and API management capabilities.\n\n## Key Features\n\n- **High Performance**: Built with Rust, utilizing multi-threading for exceptional performance.\n- **Dynamic Configuration**: Supports dynamic configuration via etcd for real-time updates across distributed systems.\n- **Flexible Routing**: Advanced routing based on host, URI, and HTTP methods with priority-based rules.\n- **Plugin Ecosystem**: Includes plugins for compression, access control, gRPC support, and more, with support for custom plugin extensions.\n- **Observability**: Exposes Prometheus metrics and integrates with Sentry for error tracking and monitoring.\n- **Distributed Configuration Management**: Admin API compatible with APISIX Admin API for resource management.\n- **Global Rules and Services**: Implements reusable global plugin behaviors and service configurations to simplify plugin and upstream reuse.\n- **Upstream Health Checks**: Provides active health checks to ensure upstream reliability.\n\n## Plugin Overview\n\nPingSIX includes multiple built-in plugins that enhance API gateway capabilities, including but not limited to:\n\n- **brotli**: Brotli compression for HTTP responses, optimizing bandwidth usage.\n- **gzip**: Gzip compression for HTTP responses.\n- **echo**: A utility plugin for testing, allowing custom headers and response bodies.\n- **grpc_web**: Support for handling gRPC-Web requests.\n- **ip_restriction**: IP-based access control.\n- **limit_count**: Rate limiting based on request count.\n- **prometheus**: Exposes API monitoring metrics.\n- **proxy_rewrite**: Supports dynamic modification of proxy request/response rules.\n- **redirect**: Allows redirecting requests to a specified URL.\n\n## Configuration Example\n\nPingSIX uses a YAML configuration format, supporting global rules, services, and upstream configurations. Example:\n\n```yaml\npingora:\n  version: 1\n  threads: 2\n  pid_file: /run/pingora.pid\n  upgrade_sock: /tmp/pingora_upgrade.sock\n  user: nobody\n  group: webusers\n\npingsix:\n  listeners:\n    - address: 0.0.0.0:8080\n\n  # etcd:\n  #   host:\n  #     - \"http://192.168.2.141:2379\"\n  #   prefix: /apisix\n\n  # admin:\n  #   address: \"0.0.0.0:8082\"\n  #   api_key: pingsix\n\n  prometheus:\n    address: 0.0.0.0:8081\n\n  sentry:\n    dsn: https://1234567890@sentry.io/123456\n\nroutes:\n  - id: 1\n    uri: /\n    host: www.baidu.com\n    upstream:\n      nodes:\n        \"www.baidu.com\": 1\n      type: roundrobin\n      checks:\n        active:\n          type: https\n          timeout: 1\n          host: www.baidu.com\n          http_path: /\n          https_verify_certificate: true\n          req_headers: [\"User-Agent: curl/7.29.0\"]\n          healthy:\n            interval: 5\n            http_statuses: [200, 201]\n            successes: 2\n          unhealthy:\n            http_failures: 5\n            tcp_failures: 2\n\nupstreams:\n  - id: 1\n    nodes:\n      \"www.taobao.com\": 1\n    type: roundrobin\n\nservices:\n  - id: 1\n    hosts: [\"www.qq.com\"]\n    upstream_id: 2\n    plugins:\n      limit-count:\n        key_type: head\n        key: Host\n        time_window: 1\n        count: 1\n        rejected_code: 429\n        rejected_msg: \"Please slow down!\"\n\nglobal_rules:\n  - id: 1\n    plugins:\n      prometheus: {}\n```\n\n## etcd Admin API\n\nIf etcd is enabled as a dynamic configuration store, PingSIX supports resource management using the Admin API, fully compatible with APISIX Admin API.\n\nExample:\n\n**Create a Route**\n```bash\ncurl http://127.0.0.1:8082/apisix/admin/routes/1 \\\n     -H \"X-API-KEY: pingsix\" \\\n     -X PUT -d '{\n       \"uri\": \"/test\",\n       \"upstream\": {\n         \"type\": \"roundrobin\",\n         \"nodes\": { \"httpbin.org\": 1 }\n       }\n     }'\n```\n\nFor more API details, refer to [APISIX Admin API documentation](https://apisix.apache.org/docs/apisix/admin-api/).\n\n## Running PingSIX\n\nRun PingSIX with the configuration file:\n\n```bash\ncargo run -- -c config.yaml\n```\n\n## Installation Guide\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/zhu327/pingsix.git\n   ```\n2. Build the project:\n   ```bash\n   cd pingsix\n   cargo build --release\n   ```\n3. Run the binary:\n   ```bash\n   ./target/release/pingsix -c config.yaml\n   ```\n\n## Observability\n\n- **Prometheus Metrics**: Exposes API monitoring data at `0.0.0.0:8081` (configurable).\n- **Sentry Tracking**: Integrates with Sentry for error analysis and performance monitoring.\n\n## Extensibility\n\nPingSIX is designed with a flexible plugin system, allowing developers to use built-in plugins or create custom ones to meet specific requirements.\n\n## License\n\nPingSIX is licensed under the Apache License 2.0. See [LICENSE](./LICENSE) for details.\n\n## Contributing\n\nContributions are welcome! Please submit a PR or open an issue for discussions or suggestions.\n\n## Acknowledgments\n\nThis project is inspired by [Cloudflare Pingora](https://github.com/cloudflare/pingora) and [APISIX](https://apisix.apache.org/), with gratitude for their excellent open-source contributions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhu327%2Fpingsix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhu327%2Fpingsix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhu327%2Fpingsix/lists"}