{"id":26976140,"url":"https://github.com/mohammadhasanii/node-http3","last_synced_at":"2026-04-28T18:40:27.443Z","repository":{"id":185570014,"uuid":"673748634","full_name":"mohammadhasanii/Node-HTTP3","owner":"mohammadhasanii","description":"This project is a starter template for building fast and lightweight web applications in Node.js using the h3 framework.","archived":false,"fork":false,"pushed_at":"2025-07-07T13:17:35.000Z","size":4127,"stargazers_count":38,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T14:37:50.966Z","etag":null,"topics":["async-await","asynchronous","caddy","h3","h3-node","http3","httphandler","nginx","node","node-http3","nodejs","reverse-proxy","tcp","tcp-server"],"latest_commit_sha":null,"homepage":"https://v1.h3.dev/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohammadhasanii.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-02T10:33:05.000Z","updated_at":"2025-07-07T13:23:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"01cf6352-f647-40e3-89e6-cef44ca276c6","html_url":"https://github.com/mohammadhasanii/Node-HTTP3","commit_stats":null,"previous_names":["mohammadhasanii/node-http3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mohammadhasanii/Node-HTTP3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhasanii%2FNode-HTTP3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhasanii%2FNode-HTTP3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhasanii%2FNode-HTTP3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhasanii%2FNode-HTTP3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohammadhasanii","download_url":"https://codeload.github.com/mohammadhasanii/Node-HTTP3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhasanii%2FNode-HTTP3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32394475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: 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":["async-await","asynchronous","caddy","h3","h3-node","http3","httphandler","nginx","node","node-http3","nodejs","reverse-proxy","tcp","tcp-server"],"created_at":"2025-04-03T11:35:52.068Z","updated_at":"2026-04-28T18:40:27.437Z","avatar_url":"https://github.com/mohammadhasanii.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node-HTTP3\n\nThis project is a simple, modern web server built in Node.js using the **h3** framework. The main goal is to demonstrate how to build a lightweight and fast application with this framework.\n\n**⚠️ Important Note:** Contrary to what its name might suggest, the `h3` framework does not natively implement the HTTP/3 protocol. `h3` is a modern, high-performance **web framework** that runs on Node.js's standard HTTP engine (HTTP/1.1 or HTTP/2).\n\nTo enable clients to connect to this application using the actual **HTTP/3** protocol, it must be deployed behind a **Reverse Proxy** like Nginx or Caddy. This guide explains how to achieve that.\n\n![Example Image](demo.png)\n\n***\n\n## ⚙️ How This Project Works\n\nThe core code creates a simple server with two routes:\n\n1.  The `/` route, which returns \"Hello World!\".\n2.  The `/hello/:name` route, which returns a personalized greeting.\n\nThis logic is implemented using the `h3` framework, known for its minimalism and high performance.\n\n```javascript\nimport { createServer } from 'node:http';\nimport { createApp, eventHandler, createRouter, toNodeListener } from 'h3';\n\nconst app = createApp();\n\nconst router = createRouter()\n    .get('/', eventHandler(() =\u003e 'Hello World!'))\n    .get('/hello/:name', eventHandler((event) =\u003e `Hello ${event.context.params.name}!`));\n\napp.use(router);\n\n// The server runs on Node's standard HTTP engine\ncreateServer(toNodeListener(app)).listen(process.env.PORT || 3000);\nconsole.log('App is running on port 3000');\n```\n\n***\n\n## 🚀 Enabling HTTP/3 with Nginx\n\nTo allow users to connect to your application via HTTP/3, we need to configure Nginx as a reverse proxy.\n\n**The final architecture will be:**\n\n`User \u003c--- (HTTP/3) ---\u003e Nginx \u003c--- (HTTP/1.1) ---\u003e Your Node.js App`\n\n### Step 1: Prerequisites\n\n1.  A server (VPS) running a Linux distribution.\n2.  A domain name pointed to your server's IP address.\n3.  **Nginx version 1.25.0 or newer**, compiled with QUIC support.\n4.  An SSL/TLS certificate for your domain (you can get one for free from Let's Encrypt).\n\n### Step 2: Run the Node.js Application\n\nFirst, run your application on the server. It's best practice to use a process manager like `pm2` to ensure the app is always running.\n\n```bash\n# Install pm2 globally\nnpm install pm2 -g\n\n# Start the application with pm2\npm2 start app.js --name \"h3-app\"\n```\n\nThis command will start your application on port `3000`.\n\n### Step 3: Configure Nginx\n\nEdit your site's Nginx configuration file (usually located at `/etc/nginx/sites-available/yourdomain.com`) with the following content:\n\n```nginx\nserver {\n    # Listen on port 443 for HTTPS, HTTP/2, and HTTP/3 traffic\n    listen 443 ssl http2;\n    listen [::]:443 ssl http2;\n    listen 443 quic reuseport;\n    listen [::]:443 quic reuseport;\n\n    # Set your domain name\n    server_name yourdomain.com;\n\n    # SSL Certificate paths\n    ssl_certificate /etc/letsencrypt/live/[yourdomain.com/fullchain.pem](https://yourdomain.com/fullchain.pem);\n    ssl_certificate_key /etc/letsencrypt/live/[yourdomain.com/privkey.pem](https://yourdomain.com/privkey.pem);\n    ssl_protocols TLSv1.2 TLSv1.3;\n\n    # Advertise HTTP/3 support to browsers\n    add_header Alt-Svc 'h3=\":443\"; ma=86400';\n\n    # Forward all requests to the Node.js application\n    location / {\n        proxy_pass http://localhost:3000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n}\n\n# (Optional) Redirect HTTP traffic to HTTPS\nserver {\n    listen 80;\n    server_name yourdomain.com;\n    return 301 https://$host$request_uri;\n}\n```\n\n### Step 4: Restart Nginx\n\nAfter saving the configuration, test it and restart Nginx.\n\n```bash\nsudo nginx -t\nsudo systemctl restart nginx\n```\n\nYour application is now accessible via your domain with full **HTTP/3** support! You can verify this using online tools like **HTTP/3 Check**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadhasanii%2Fnode-http3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadhasanii%2Fnode-http3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadhasanii%2Fnode-http3/lists"}