1
0

index.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!DOCTYPE html>
  2. <html lang="en" data-base-path="&#x2F;cpp-httplib">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>cpp-httplib - cpp-httplib</title>
  7. <link rel="icon" type="image/svg+xml" href="&#x2F;cpp-httplib/favicon.svg">
  8. <link rel="stylesheet" href="&#x2F;cpp-httplib/css/main.css">
  9. <script>
  10. (function() {
  11. var t = localStorage.getItem('preferred-theme');
  12. if (!t) t = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
  13. if (t === 'light') document.documentElement.setAttribute('data-theme', 'light');
  14. })();
  15. </script>
  16. </head>
  17. <body>
  18. <header class="header">
  19. <div class="header-inner">
  20. <a href="&#x2F;cpp-httplib&#x2F;en/" class="header-title">cpp-httplib <span style="font-size:0.75em;font-weight:normal;margin-left:4px">v0.36.0</span></a>
  21. <div class="header-spacer"></div>
  22. <nav class="header-nav">
  23. <a href="&#x2F;cpp-httplib&#x2F;en/">
  24. <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
  25. Home
  26. </a>
  27. <a href="&#x2F;cpp-httplib&#x2F;en/tour&#x2F;">
  28. <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"/></svg>
  29. Tour
  30. </a>
  31. <a href="https:&#x2F;&#x2F;github.com&#x2F;yhirose&#x2F;cpp-httplib" aria-label="GitHub">
  32. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg>
  33. GitHub
  34. </a>
  35. </nav>
  36. <div class="header-tools">
  37. <button class="search-btn" aria-label="Search (⌘K)">
  38. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
  39. </button>
  40. <button class="theme-toggle" aria-label="Toggle theme"></button>
  41. <div class="lang-selector">
  42. <button class="lang-btn" aria-label="Language">
  43. <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>
  44. EN
  45. </button>
  46. <ul class="lang-popup">
  47. <li><a href="#" data-lang="en">EN</a></li>
  48. <li><a href="#" data-lang="ja">JA</a></li>
  49. </ul>
  50. </div>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="layout no-sidebar">
  55. <main class="content portal">
  56. <article>
  57. <h1>cpp-httplib</h1>
  58. <p><a href="https://github.com/yhirose/cpp-httplib">cpp-httplib</a> is an HTTP/HTTPS library for C++. Just copy a single header file, <a href="https://github.com/yhirose/cpp-httplib/raw/refs/tags/latest/httplib.h"><code>httplib.h</code></a>, and you're ready to go.</p>
  59. <p>When you need a quick HTTP server or client in C++, you want something that just works. That's exactly why I built cpp-httplib. You can start writing both servers and clients in just a few lines of code.</p>
  60. <p>The API uses a lambda-based design that feels natural. It runs anywhere you have a C++11 or later compiler. Windows, macOS, Linux — use whatever environment you already have.</p>
  61. <p>HTTPS works too. Just link OpenSSL or mbedTLS, and both server and client gain TLS support. Content-Encoding (gzip, Brotli, etc.), file uploads, and other features you actually need in real-world development are all included. WebSocket is also supported.</p>
  62. <p>Under the hood, it uses blocking I/O with a thread pool. It's not built for handling massive numbers of simultaneous connections. But for API servers, embedded HTTP in tools, mock servers for testing, and many other use cases, it delivers solid performance.</p>
  63. <p>"Solve today's problem, today." That's the kind of simplicity cpp-httplib aims for.</p>
  64. <h2>Documentation</h2>
  65. <ul>
  66. <li><a href="tour/">A Tour of cpp-httplib</a> — A step-by-step tutorial covering the basics. Start here if you're new</li>
  67. <li><a href="cookbook/">Cookbook</a> — A collection of recipes organized by topic. Jump to whatever you need</li>
  68. </ul>
  69. </article>
  70. </main>
  71. </div>
  72. <footer class="footer">
  73. © 2026 Yuji Hirose. All rights reserved.
  74. </footer>
  75. <!-- Search modal -->
  76. <div class="search-overlay" id="search-overlay">
  77. <div class="search-modal">
  78. <div class="search-input-wrap">
  79. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
  80. <input type="text" id="search-input" placeholder="Search..." autocomplete="off" spellcheck="false">
  81. <kbd class="search-esc">ESC</kbd>
  82. </div>
  83. <ul class="search-results" id="search-results"></ul>
  84. </div>
  85. </div>
  86. <script src="&#x2F;cpp-httplib/js/main.js"></script>
  87. </body>
  88. </html>