{"id":2134459,"url":"https://github.com/jmjoy/fastcgi-client-rs","last_synced_at":"2025-08-11T09:11:11.034Z","repository":{"id":41867014,"uuid":"190755744","full_name":"jmjoy/fastcgi-client-rs","owner":"jmjoy","description":"Fastcgi client implemented for Rust.","archived":false,"fork":false,"pushed_at":"2025-07-17T02:07:23.000Z","size":150,"stargazers_count":25,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-04T04:38:04.614Z","etag":null,"topics":["async-std","fastcgi","fastcgi-client","futures","rust","rust-library"],"latest_commit_sha":null,"homepage":"https://docs.rs/fastcgi-client/","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/jmjoy.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":"2019-06-07T14:19:27.000Z","updated_at":"2025-07-17T02:05:51.000Z","dependencies_parsed_at":"2024-10-16T00:01:06.895Z","dependency_job_id":"84a99073-c64d-4104-a30c-3aaa8863bd01","html_url":"https://github.com/jmjoy/fastcgi-client-rs","commit_stats":{"total_commits":91,"total_committers":4,"mean_commits":22.75,"dds":"0.10989010989010994","last_synced_commit":"19dc10b6407a9b9c4d12fbf3a8f43fcf398b0aa2"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/jmjoy/fastcgi-client-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmjoy%2Ffastcgi-client-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmjoy%2Ffastcgi-client-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmjoy%2Ffastcgi-client-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmjoy%2Ffastcgi-client-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmjoy","download_url":"https://codeload.github.com/jmjoy/fastcgi-client-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmjoy%2Ffastcgi-client-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269857560,"owners_count":24486395,"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-08-11T02:00:10.019Z","response_time":75,"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":["async-std","fastcgi","fastcgi-client","futures","rust","rust-library"],"created_at":"2024-01-21T23:53:13.746Z","updated_at":"2025-08-11T09:11:11.005Z","avatar_url":"https://github.com/jmjoy.png","language":"Rust","readme":"# fastcgi-client-rs\n\n[![Rust](https://github.com/jmjoy/fastcgi-client-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/jmjoy/fastcgi-client-rs/actions/workflows/rust.yml)\n[![Crate](https://img.shields.io/crates/v/fastcgi-client.svg)](https://crates.io/crates/fastcgi-client)\n[![API](https://docs.rs/fastcgi-client/badge.svg)](https://docs.rs/fastcgi-client)\n\nFastcgi client implemented for Rust, power by [tokio](https://crates.io/crates/tokio).\n\n## Installation\n\nAdd dependencies to your `Cargo.toml` by `cargo add`:\n\n```shell\ncargo add tokio --features full\ncargo add fastcgi-client\n```\n\n## Examples\n\nShort connection mode:\n\n```rust, no_run\nuse fastcgi_client::{Client, Params, Request};\nuse std::env;\nuse tokio::{io, net::TcpStream};\n\n#[tokio::main]\nasync fn main() {\n    let script_filename = env::current_dir()\n        .unwrap()\n        .join(\"tests\")\n        .join(\"php\")\n        .join(\"index.php\");\n    let script_filename = script_filename.to_str().unwrap();\n    let script_name = \"/index.php\";\n\n    // Connect to php-fpm default listening address.\n    let stream = TcpStream::connect((\"127.0.0.1\", 9000)).await.unwrap();\n    let mut client = Client::new(stream);\n\n    // Fastcgi params, please reference to nginx-php-fpm config.\n    let params = Params::default()\n        .request_method(\"GET\")\n        .script_name(script_name)\n        .script_filename(script_filename)\n        .request_uri(script_name)\n        .document_uri(script_name)\n        .remote_addr(\"127.0.0.1\")\n        .remote_port(12345)\n        .server_addr(\"127.0.0.1\")\n        .server_port(80)\n        .server_name(\"jmjoy-pc\")\n        .content_type(\"\")\n        .content_length(0);\n\n    // Fetch fastcgi server(php-fpm) response.\n    let output = client.execute_once(Request::new(params, \u0026mut io::empty())).await.unwrap();\n\n    // \"Content-type: text/html; charset=UTF-8\\r\\n\\r\\nhello\"\n    let stdout = String::from_utf8(output.stdout.unwrap()).unwrap();\n\n    assert!(stdout.contains(\"Content-type: text/html; charset=UTF-8\"));\n    assert!(stdout.contains(\"hello\"));\n    assert_eq!(output.stderr, None);\n}\n```\n\nKeep alive mode:\n\n```rust, no_run\nuse fastcgi_client::{Client, Params, Request};\nuse std::env;\nuse tokio::{io, net::TcpStream};\n\n#[tokio::main]\nasync fn main() {\n    // Connect to php-fpm default listening address.\n    let stream = TcpStream::connect((\"127.0.0.1\", 9000)).await.unwrap();\n    let mut client = Client::new_keep_alive(stream);\n\n    // Fastcgi params, please reference to nginx-php-fpm config.\n    let params = Params::default();\n\n    for _ in (0..3) {\n        // Fetch fastcgi server(php-fpm) response.\n        let output = client.execute(Request::new(params.clone(), \u0026mut io::empty())).await.unwrap();\n\n        // \"Content-type: text/html; charset=UTF-8\\r\\n\\r\\nhello\"\n        let stdout = String::from_utf8(output.stdout.unwrap()).unwrap();\n\n        assert!(stdout.contains(\"Content-type: text/html; charset=UTF-8\"));\n        assert!(stdout.contains(\"hello\"));\n        assert_eq!(output.stderr, None);\n    }\n}\n```\n\n## License\n\n[Apache-2.0](https://github.com/jmjoy/fastcgi-client-rs/blob/master/LICENSE).\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmjoy%2Ffastcgi-client-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmjoy%2Ffastcgi-client-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmjoy%2Ffastcgi-client-rs/lists"}