{"id":38788204,"url":"https://github.com/marlecce/emme","last_synced_at":"2026-01-17T12:35:48.485Z","repository":{"id":286479351,"uuid":"927931432","full_name":"marlecce/emme","owner":"marlecce","description":"High-performance C web server engineered trying to outpace industry giants like Nginx and Apache. Powered by io_uring and a custom in-place HTTP parser, it delivers ultra-low latency and blazing-fast responses.","archived":false,"fork":false,"pushed_at":"2025-08-23T16:36:13.000Z","size":243,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-24T04:42:44.904Z","etag":null,"topics":["apache","automation","c","github-actions","http-parser","https-server","io-uring","nginx","testing","threading","web-server","yaml"],"latest_commit_sha":null,"homepage":"","language":"C","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/marlecce.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,"zenodo":null}},"created_at":"2025-02-05T19:24:29.000Z","updated_at":"2025-08-23T16:35:50.000Z","dependencies_parsed_at":"2025-06-14T13:18:30.304Z","dependency_job_id":"10dbe23e-2893-4a6b-9ad9-1528bf0bd583","html_url":"https://github.com/marlecce/emme","commit_stats":null,"previous_names":["marlecce/emme"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marlecce/emme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlecce%2Femme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlecce%2Femme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlecce%2Femme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlecce%2Femme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marlecce","download_url":"https://codeload.github.com/marlecce/emme/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlecce%2Femme/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["apache","automation","c","github-actions","http-parser","https-server","io-uring","nginx","testing","threading","web-server","yaml"],"created_at":"2026-01-17T12:35:48.368Z","updated_at":"2026-01-17T12:35:48.472Z","avatar_url":"https://github.com/marlecce.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# emme\n\nThis project implements a high-performance web server in C that aims to outperform popular servers like Nginx and Apache. It leverages advanced features such as **io_uring** for asynchronous I/O and a custom thread pool to efficiently handle multiple client connections. A lightweight, in-place HTTP parser is integrated to minimize overhead and maximize performance.\n\n## Features\n\n- **Asynchronous I/O with io_uring:** Efficiently handles I/O operations without blocking.\n- **Custom Thread Pool:** Manages concurrent client connections.\n- **Optimized HTTP Parsing:** Minimalist in-place HTTP parser for fast request handling.\n- **Advanced Logging Module:**\n  - **Asynchronous Logging:** Uses a lock-free ring buffer and a dedicated logging thread to minimize performance impact.\n  - **Configurable Log Output:** Supports multiple appenders (e.g., file and console) via an array-based configuration.\n  - **Log Rollover:** Rollover based on file size or daily rotation.\n- **Configurable:** Loads settings from a YAML configuration file.\n- **HTTPS by Default:**\n  - **TLS Termination:** The server terminates TLS connections using OpenSSL.\n  - **SSL/TLS Configuration:** Certificate and private key settings are loaded from the configuration file.\n  - **Self-Signed Certificate for Development:** A script is provided to generate a self-signed certificate for development and testing.\n  - **Production Guidance:** Clear instructions on obtaining and configuring a certificate from a trusted CA for production use.\n\n## Project Structure\n\n- **src/main.c**: Entry point that loads configuration, initializes the logger, and starts the server.\n- **src/server.c**: Main server logic including the event loop using io_uring, connection handling, and TLS handshake.\n- **src/http_parser.c / include/http_parser.h**: Custom HTTP parser implementation.\n- **src/config.c / include/config.h**: Configuration file loader for server settings (including logging and SSL configuration).\n- **src/advanced_log.c / include/advanced_log.h**: Advanced logging module implementation.\n- **include/logging_common.h**: Shared logging definitions (log levels, formats, and the LoggingConfig structure).\n- **src/tls.c / include/tls.h**: TLS module using OpenSSL to create and manage the SSL context.\n- **Tests**:  \n  - **tests/test_http_parser.c**: Unit tests for the HTTP parser.\n  - Additional tests (e.g., test_config, test_server) can be added.\n- **config.yaml**: Sample configuration file.\n- **scripts/generate_cert.sh**: Shell script to generate a self-signed certificate for development.\n\n## Configuration\n\nThe server configuration is loaded from a YAML file (e.g., config.yaml). A sample configuration file might look like:\n\n```yaml\nserver:\n  port: 8443\n  max_connections: 100\n  log_level: DEBUG\n  routes:\n    - path: /static/\n      technology: static\n      document_root: /var/www/html\n    - path: /api/\n      technology: reverse_proxy\n      backend: 127.0.0.1:5000\n\nlogging:\n  file: /var/log/emme.log           # Full path or file name for the log file\n  level: \"debug\"                    # Log level: debug, info, warn, error\n  format: \"json\"                    # Log format: json or plain\n  buffer_size: 4096                 # Ring buffer size (number of log messages)\n  rollover_size: 10485760           # Maximum file size in bytes before rollover (e.g., 10 MB)\n  rollover_daily: true              # Enable daily rollover\n  appender_flags:\n    - file                        # Enable file logging\n    - console                     # Enable console logging\n\nssl:\n  certificate: certs/dev.crt      # Path to the SSL certificate (self-signed for development)\n  private_key: certs/dev.key\"       # Path to the SSL private key (self-signed for development)\n```\n\nAdjust these settings as needed for your environment.\n\n## HTTPS Setup\n\n### Development (Self-Signed Certificate)\n\nFor development and testing, a self-signed certificate is provided. To generate a self-signed certificate:\n\n1. Navigate to the scripts/ directory (or the root of the project if placed there).\n\n2. Run the provided script:\n\n```bash\n./generate_cert.sh\n```\n\nThis script will generate:\n\n- certs/dev.crt: The self-signed certificate.\n- certs/dev.key: The corresponding private key.\n\nThese files will be used by default as specified in the config.yaml under the ssl: section. Note that self-signed certificates are not trusted by browsers or clients by default, and you will see warnings—but this is acceptable for development purposes.\n\n### Production\n\nFor a production environment, you should use a certificate signed by a trusted Certificate Authority (CA). To configure your server for production:\n\n1. Obtain a certificate and private key from a CA (e.g., via Let's Encrypt).\n\n2. Update the config.yaml with the appropriate paths:\n\n```yaml\nssl:\n  certificate: /etc/ssl/certs/your_domain.crt\n  private_key: /etc/ssl/private/your_domain.key\n```\n\n3. Ensure the certificate and key files have the correct permissions and are securely stored.\n\n## Build Instructions\n\nEnsure that you have the required dependencies installed:\n\n- `liburing`\n- `pthread`\n- `libYAML`\n- `libnghttp2-dev`\n- OpenSSL development libraries (e.g., `libssl-dev`)\n\nTo install all necessary dependencies, try the following script:\n\n```sh\n./scripts/install_deps.sh\n```\n\nTo compile the project, run:\n\n```bash\nmake clean \u0026\u0026 make\n```\n\n## Usage\n\nStart the server by running:\n\n```bash\n./emme\n```\n\nThe server will listen on the configured HTTPS port (e.g., 8443) and handle incoming HTTPS requests. Use a browser or tool like curl to test:\n\n```bash\ncurl -vk https://localhost:8443\n```\n\n## Performance tests\n\n```bash\nh2load -n100 -c10 -m2 https://localhost:8443/\n```\n\n## Pipeline tests\n\n```bash\nact -j fedora-build --container-architecture linux/amd64\nact -j ubuntu-build\n```\n\n## Coverage\n\nThe coverage is available [here](https://marlecce.github.io/emme/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarlecce%2Femme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarlecce%2Femme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarlecce%2Femme/lists"}