{"id":23900712,"url":"https://github.com/cod-e-codes/rust-simple-http-server","last_synced_at":"2025-07-19T12:37:38.110Z","repository":{"id":269442503,"uuid":"907426178","full_name":"Cod-e-Codes/rust-simple-http-server","owner":"Cod-e-Codes","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-23T15:16:47.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T09:43:36.473Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Cod-e-Codes.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-12-23T14:55:04.000Z","updated_at":"2024-12-24T18:10:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"17ea5ed1-d3dc-42e9-a986-2c1978362a9d","html_url":"https://github.com/Cod-e-Codes/rust-simple-http-server","commit_stats":null,"previous_names":["cod-e-codes/rust-simple-http-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cod-e-Codes/rust-simple-http-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Frust-simple-http-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Frust-simple-http-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Frust-simple-http-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Frust-simple-http-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cod-e-Codes","download_url":"https://codeload.github.com/Cod-e-Codes/rust-simple-http-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Frust-simple-http-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265934248,"owners_count":23852092,"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":[],"created_at":"2025-01-04T20:36:54.937Z","updated_at":"2025-07-19T12:37:38.059Z","avatar_url":"https://github.com/Cod-e-Codes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust Simple HTTP Server\n\nA lightweight and asynchronous HTTP server written in Rust using the `tokio` runtime. This server listens on `127.0.0.1:3000` and responds with a simple HTML page.\n\n## Features\n- **Asynchronous TCP handling**: Utilizes `tokio` for efficient, non-blocking IO operations.\n- **Simple request handling**: Parses incoming requests and responds with an HTML page.\n- **Concurrent connections**: Handles multiple client connections simultaneously using `tokio::spawn`.\n\n## Requirements\n- [Rust](https://www.rust-lang.org/) (version 1.65.0 or later)\n- [Tokio](https://tokio.rs/) (runtime for asynchronous programming in Rust)\n\n## Installation\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/Cod-e-Codes/rust-simple-http-server.git\n   cd rust-simple-http-server\n   ```\n2. Build the project:\n   ```bash\n   cargo build --release\n   ```\n3. Run the project:\n   ```bash\n   cargo run\n   ```\n\n## Usage\n1. Start the server:\n   ```bash\n   cargo run\n   ```\n2. Open your browser and navigate to [http://127.0.0.1:3000](http://127.0.0.1:3000).\n3. You will see the following response:\n\n   ```html\n   \u003chtml\u003e\u003cbody\u003e\u003ch1\u003eWelcome to Rust HTTP Server!\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e\n   ```\n\n## How It Works\n1. **Binding to a socket**: The server binds to the IP address `127.0.0.1` on port `3000`.\n2. **Listening for connections**: Listens for incoming TCP connections using `tokio::net::TcpListener`.\n3. **Handling requests**: Reads incoming data, logs the HTTP request, and sends a fixed HTML response.\n4. **Concurrency**: Each connection is handled in a separate asynchronous task (`tokio::spawn`).\n\n## Example Request and Response\n### Request:\n```\nGET / HTTP/1.1\nHost: 127.0.0.1:3000\n```\n\n### Response:\n```\nHTTP/1.1 200 OK\n\n\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eWelcome to Rust HTTP Server!\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e\n```\n\n## File Structure\n- **`main.rs`**: Contains the server logic, request handling, and response generation.\n\n## Dependencies\n- `tokio`: Provides asynchronous runtime and utilities for handling networking tasks.\n\n## License\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n\n## Contributing\nContributions are welcome! Feel free to open an issue or submit a pull request.\n\n## Future Enhancements\n- Add support for parsing HTTP headers.\n- Extend the server to handle different routes.\n- Implement a configuration file for customizable settings (e.g., port, IP address).\n- Improve error handling and logging.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcod-e-codes%2Frust-simple-http-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcod-e-codes%2Frust-simple-http-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcod-e-codes%2Frust-simple-http-server/lists"}