{"id":36681127,"url":"https://github.com/harsh-panchal-804/https-server-in-c","last_synced_at":"2026-01-12T11:00:30.964Z","repository":{"id":288805943,"uuid":"966954839","full_name":"harsh-panchal-804/HTTPS-Server-in-C","owner":"harsh-panchal-804","description":"A multithreaded HTTPS server written in C using POSIX sockets and OpenSSL, built for Linux. It supports URI-based routing, serves static and dynamic content from a Next.js portfolio, and handles concurrent requests using a thread-per-connection model. Designed to be lightweight, secure, and fast for low-level systems and web integration.","archived":false,"fork":false,"pushed_at":"2025-11-10T05:57:39.000Z","size":90099,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-10T07:18:38.727Z","etag":null,"topics":["aceternity-ui","c","http-server","linux","network-programming","nextjs","shadcn-ui"],"latest_commit_sha":null,"homepage":"https://harshpanchal.duckdns.org:6970/","language":"HTML","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/harsh-panchal-804.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-15T17:47:52.000Z","updated_at":"2025-11-10T05:57:43.000Z","dependencies_parsed_at":"2025-04-19T20:17:00.932Z","dependency_job_id":"4c519d8c-716a-4d3a-9348-a50c7493f7d0","html_url":"https://github.com/harsh-panchal-804/HTTPS-Server-in-C","commit_stats":null,"previous_names":["harsh-panchal-804/http-server-in-c","harsh-panchal-804/https-server-in-c"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/harsh-panchal-804/HTTPS-Server-in-C","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harsh-panchal-804%2FHTTPS-Server-in-C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harsh-panchal-804%2FHTTPS-Server-in-C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harsh-panchal-804%2FHTTPS-Server-in-C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harsh-panchal-804%2FHTTPS-Server-in-C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harsh-panchal-804","download_url":"https://codeload.github.com/harsh-panchal-804/HTTPS-Server-in-C/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harsh-panchal-804%2FHTTPS-Server-in-C/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["aceternity-ui","c","http-server","linux","network-programming","nextjs","shadcn-ui"],"created_at":"2026-01-12T11:00:16.662Z","updated_at":"2026-01-12T11:00:30.956Z","avatar_url":"https://github.com/harsh-panchal-804.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Multithreaded HTTPS Server in C\n\nA lightweight, multithreaded HTTPS server implemented in C using POSIX sockets, OpenSSL and pthreads. This server runs on Linux, serves static files, and supports URI-based routing. It is designed for educational and practical use, demonstrating core concepts of network programming, concurrency, and HTTP protocol handling.\n\n---\n\n## Demo\nThe project is deployed on [AWS](https://harshpanchal.duckdns.org:6970/)\n\nWatch the demo (It takes some time to load or go to the demo_video folder ) -\u003e\n![Demo GIF](demo_video/server.gif)\n\n## Stress Testing\n\nStress tested via Apache Bench with n=10,000 and c=20 -\u003e \n\n![Stress_Test GIF](demo_video/http%20server%20stress%20test.gif)\n\nKcachegrind call map-\u003e\n\n\u003cimg src=\"demo_video/kcache_http_img.png\"\u003e\n\n\n## Features\n\n- **POSIX Sockets**: Handles TCP connections using the standard Linux socket API.\n- **TLS via OpenSSL**: Secures all client-server communications using SSL/TLS encryption through the OpenSSL library.\n- **Multithreaded**: Uses pthreads to process multiple client requests concurrently.\n- **Static File Serving**: Delivers HTML, JPEG, CSS, JavaScript and other static files from a specified directory.\n- **URI-Based Routing**: Maps incoming HTTP requests to files or handler functions based on the URI.\n- **HTTP/1.0 Support**: Implements the GET and HEAD methods, responding to invalid requests with proper error messages.\n- **Linux Only**: Developed and tested on Linux systems.\n\n---\n\n## References\n\n- **Beej's Guide to Network Programming**\n[Beej's Guide to Network Programming (Official Site)](https://beej.us/guide/bgnet/pdf/bgnet_a4_c_1.pdf)\n- **Arch Linux Networking Man Pages**\n[socket(7) - Sockets API Overview](https://man.archlinux.org/man/socket.7.en)\n[tcp(7) - TCP Protocol](https://man.archlinux.org/man/tcp.7.en)\n[udp(7) - UDP Protocol](https://man.archlinux.org/man/udp.7.en)\n[epoll(7) - epoll API](https://man.archlinux.org/man/epoll.7.en)\n[select(2) - I/O Multiplexing](https://man.archlinux.org/man/select.2.en)\n[poll(2) - I/O Multiplexing](https://man.archlinux.org/man/poll.2.en)\n[accept(2) - Accept Connections](https://man.archlinux.org/man/accept.2.en)\n[bind(2) - Bind Socket](https://man.archlinux.org/man/bind.2.en)\n[connect(2) - Connect Socket](https://man.archlinux.org/man/connect.2.en)\n[listen(2) - Listen for Connections](https://man.archlinux.org/man/listen.2.en)\n[send(2) - Send Data](https://man.archlinux.org/man/send.2.en)\n[recv(2) - Receive Data](https://man.archlinux.org/man/recv.2.en)\n[shutdown(2) - Shutdown Connection](https://man.archlinux.org/man/shutdown.2.en)\n- **Book Reference**\nDouglas Comer - Internetworking with TCP/IP\n\u003cimg src=\"./demo_video/book.jpeg\"\u003e\n\n## Installation\n\n### Prerequisites\n\n- GCC (GNU Compiler Collection)\n- GNU Make\n- Linux OS\n- POSIX pthreads library (usually included by default)\n\n\n### Clone the Repository\n\n```bash\ngit clone https://github.com/harsh-panchal-804/HTTP-Server-in-C\n\n```\n\n\n\n---\n\n## Build and Run\n\n### Build\n\nCompile the server using the provided Makefile:\n\n```bash\nmake\n```\n\n\n### Run\n\nStart the server with:\n\n```bash\n./server\n```\n\nBy default, the server listens on a specified port (e.g., 6970). You can access it from your browser or with tools like `curl`:\n\n```\nhttp://localhost:6970/\n```\n\n## Usage\n\n- Place your static files (e.g., HTML, JPEG) in the server's root directory.\n- The server will map URIs to files (e.g., `/about.html` serves `about.html` from the root).\n- The server can handle multiple connections.\n- Error responses are sent as HTML for easy debugging in browsers.\n\n---\n\n\n## Project Structure\n\n- `server.c` – Main server implementation (sockets, threads, routing)\n- `Makefile` – Build instructions\n- `README.md` – Project documentation\n\n---\n\n## License\n\nThis project is open-source. See the `LICENSE` file for details.\n\n---\n\n## Contributing\n\nPull requests and suggestions are welcome! Please open an issue to discuss changes or report bugs.\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharsh-panchal-804%2Fhttps-server-in-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharsh-panchal-804%2Fhttps-server-in-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharsh-panchal-804%2Fhttps-server-in-c/lists"}