httpp 0.8.0__tar.gz → 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. httpp-0.9.0/.github/workflows/docs.yml +47 -0
  2. {httpp-0.8.0 → httpp-0.9.0}/.github/workflows/orchestrator.yml +6 -0
  3. httpp-0.9.0/.github/workflows/pages.yml +61 -0
  4. {httpp-0.8.0 → httpp-0.9.0}/.gitignore +3 -1
  5. {httpp-0.8.0 → httpp-0.9.0}/CHANGELOG.md +61 -2
  6. {httpp-0.8.0 → httpp-0.9.0}/CMakeLists.txt +20 -20
  7. {httpp-0.8.0 → httpp-0.9.0}/HANDOFF.md +42 -6
  8. {httpp-0.8.0 → httpp-0.9.0}/PKG-INFO +31 -15
  9. {httpp-0.8.0 → httpp-0.9.0}/README.md +30 -14
  10. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/CMakeLists.txt +7 -3
  11. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/README.md +17 -1
  12. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/bench.py +1 -1
  13. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/bench_setup.py +5 -0
  14. httpp-0.9.0/benchmarks/client_worker.py +144 -0
  15. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/cpp/cpp_bench.cpp +3 -3
  16. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/cpu_bench.py +1 -1
  17. httpp-0.9.0/benchmarks/diag_async_client.py +104 -0
  18. httpp-0.9.0/benchmarks/diag_sync_client.py +111 -0
  19. httpp-0.9.0/benchmarks/gzip_app.py +18 -0
  20. httpp-0.9.0/benchmarks/gzip_bench.py +39 -0
  21. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/io_bench.py +1 -1
  22. httpp-0.9.0/benchmarks/results/.gitignore +4 -0
  23. httpp-0.9.0/benchmarks/results/full/cpp.json +1312 -0
  24. httpp-0.9.0/benchmarks/results/full/py314.json +2864 -0
  25. httpp-0.9.0/benchmarks/results/full/py314t.json +2644 -0
  26. httpp-0.9.0/benchmarks/results/full/system.json +73 -0
  27. httpp-0.9.0/benchmarks/run.sh +43 -0
  28. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/suite.py +215 -14
  29. httpp-0.9.0/benchmarks/suite_aiohttp.py +50 -0
  30. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/suite_app.py +3 -0
  31. {httpp-0.8.0 → httpp-0.9.0}/checklist.md +17 -13
  32. {httpp-0.8.0 → httpp-0.9.0}/docs/Architecture.md +3 -3
  33. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0003-engine-and-third-party.md +2 -2
  34. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0005-multiprocess-workers.md +1 -1
  35. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0011-logging.md +4 -0
  36. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0032-read-only-file-browser.md +12 -1
  37. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0037-middleware-through-use.md +2 -0
  38. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0042-test-client.md +1 -1
  39. httpp-0.9.0/docs/adr/0043-websocket-close-1001-on-drain.md +45 -0
  40. httpp-0.9.0/docs/adr/0044-worker-respawn.md +43 -0
  41. httpp-0.9.0/docs/adr/0045-conditional-static-files.md +42 -0
  42. httpp-0.9.0/docs/adr/0046-testclient-websocket-and-files.md +43 -0
  43. httpp-0.9.0/docs/adr/0047-one-mime-table-and-exchange-leak.md +43 -0
  44. httpp-0.9.0/docs/adr/0048-websocket-on-routers-and-dependencies.md +26 -0
  45. httpp-0.9.0/docs/adr/0049-split-the-cython-module-into-pxi-files.md +21 -0
  46. httpp-0.9.0/docs/adr/0050-own-logging-module-replaces-aixlog.md +28 -0
  47. httpp-0.9.0/docs/adr/0051-sync-client-on-the-async-engine.md +44 -0
  48. httpp-0.9.0/docs/adr/0052-downloads-stream-through-a-body-sink.md +42 -0
  49. httpp-0.9.0/docs/adr/0053-cpp-httplib-removed.md +26 -0
  50. httpp-0.9.0/docs/adr/0054-own-file-system-module.md +37 -0
  51. httpp-0.9.0/docs/adr/0055-httpp-path-class.md +27 -0
  52. httpp-0.9.0/docs/adr/0056-operating-system-log-handlers.md +27 -0
  53. httpp-0.9.0/docs/adr/0057-public-logging-module.md +28 -0
  54. httpp-0.9.0/docs/adr/0058-fs-merged-into-path.md +25 -0
  55. httpp-0.9.0/docs/adr/0059-free-threaded-pool-starts-at-two.md +48 -0
  56. httpp-0.9.0/docs/adr/0060-docs-site.md +32 -0
  57. httpp-0.9.0/docs/adr/0061-server-gzip-defaults.md +35 -0
  58. httpp-0.9.0/docs/adr/0062-request-names-match-python.md +28 -0
  59. httpp-0.9.0/docs/adr/0063-benchmark-json-and-docs-page.md +36 -0
  60. httpp-0.9.0/docs/adr/0064-docs-site-on-github-pages.md +29 -0
  61. httpp-0.9.0/docs/adr/0065-file-browser-builder.md +29 -0
  62. httpp-0.9.0/docs/adr/0066-option-structs-become-builders.md +28 -0
  63. httpp-0.9.0/docs/adr/0067-urls-are-httpp-url-and-proxy-is-a-url.md +28 -0
  64. httpp-0.9.0/docs/adr/0068-socks5-proxy.md +19 -0
  65. httpp-0.9.0/docs/adr/0069-forwarded-headers.md +28 -0
  66. httpp-0.9.0/docs/adr/0070-file-browser-safe-mode.md +42 -0
  67. httpp-0.9.0/docs/adr/0071-client-pool-keeps-every-connection-of-a-burst.md +42 -0
  68. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/README.md +28 -1
  69. {httpp-0.8.0 → httpp-0.9.0}/docs/agent.md +2 -2
  70. httpp-0.9.0/docs/site/.gitignore +4 -0
  71. httpp-0.9.0/docs/site/README.md +47 -0
  72. httpp-0.9.0/docs/site/docs/benchmarks.mdx +48 -0
  73. httpp-0.9.0/docs/site/docs/client/download.mdx +87 -0
  74. httpp-0.9.0/docs/site/docs/client/get-request.mdx +38 -0
  75. httpp-0.9.0/docs/site/docs/client/post-request.mdx +47 -0
  76. httpp-0.9.0/docs/site/docs/install.mdx +58 -0
  77. httpp-0.9.0/docs/site/docs/intro.mdx +23 -0
  78. httpp-0.9.0/docs/site/docs/server/file-browser.mdx +76 -0
  79. httpp-0.9.0/docs/site/docs/server/get-route.mdx +46 -0
  80. httpp-0.9.0/docs/site/docs/server/hooks.mdx +46 -0
  81. httpp-0.9.0/docs/site/docs/server/request-data.mdx +47 -0
  82. httpp-0.9.0/docs/site/docs/server/responses.mdx +55 -0
  83. httpp-0.9.0/docs/site/docs/server/send-file.mdx +46 -0
  84. httpp-0.9.0/docs/site/docs/server/serve-directory.mdx +60 -0
  85. httpp-0.9.0/docs/site/docusaurus.config.ts +42 -0
  86. httpp-0.9.0/docs/site/languages.json +4 -0
  87. httpp-0.9.0/docs/site/package-lock.json +16200 -0
  88. httpp-0.9.0/docs/site/package.json +33 -0
  89. httpp-0.9.0/docs/site/scripts/prepare.py +123 -0
  90. httpp-0.9.0/docs/site/scripts/test_snippets.py +322 -0
  91. httpp-0.9.0/docs/site/sidebars.ts +21 -0
  92. httpp-0.9.0/docs/site/snippets/cpp/client_get.cpp +12 -0
  93. httpp-0.9.0/docs/site/snippets/cpp/client_post.cpp +13 -0
  94. httpp-0.9.0/docs/site/snippets/cpp/download_async.cpp +13 -0
  95. httpp-0.9.0/docs/site/snippets/cpp/download_file.cpp +8 -0
  96. httpp-0.9.0/docs/site/snippets/cpp/download_verified.cpp +15 -0
  97. httpp-0.9.0/docs/site/snippets/cpp/file_browser.cpp +10 -0
  98. httpp-0.9.0/docs/site/snippets/cpp/get_route.cpp +11 -0
  99. httpp-0.9.0/docs/site/snippets/cpp/hooks.cpp +22 -0
  100. httpp-0.9.0/docs/site/snippets/cpp/request_info.cpp +14 -0
  101. httpp-0.9.0/docs/site/snippets/cpp/responses.cpp +22 -0
  102. httpp-0.9.0/docs/site/snippets/cpp/send_file.cpp +13 -0
  103. httpp-0.9.0/docs/site/snippets/cpp/serve_folder.cpp +8 -0
  104. httpp-0.9.0/docs/site/snippets/python/client_get.py +8 -0
  105. httpp-0.9.0/docs/site/snippets/python/client_post.py +12 -0
  106. httpp-0.9.0/docs/site/snippets/python/download_async.py +11 -0
  107. httpp-0.9.0/docs/site/snippets/python/download_file.py +4 -0
  108. httpp-0.9.0/docs/site/snippets/python/download_verified.py +11 -0
  109. httpp-0.9.0/docs/site/snippets/python/file_browser.py +7 -0
  110. httpp-0.9.0/docs/site/snippets/python/get_route.py +12 -0
  111. httpp-0.9.0/docs/site/snippets/python/hooks.py +23 -0
  112. httpp-0.9.0/docs/site/snippets/python/request_info.py +17 -0
  113. httpp-0.9.0/docs/site/snippets/python/responses.py +20 -0
  114. httpp-0.9.0/docs/site/snippets/python/send_file.py +13 -0
  115. httpp-0.9.0/docs/site/snippets/python/serve_folder.py +7 -0
  116. httpp-0.9.0/docs/site/src/components/Bench.module.css +104 -0
  117. httpp-0.9.0/docs/site/src/components/Bench.tsx +361 -0
  118. httpp-0.9.0/docs/site/src/components/Lang.module.css +40 -0
  119. httpp-0.9.0/docs/site/src/components/Lang.tsx +45 -0
  120. httpp-0.9.0/docs/site/src/components/LangContext.tsx +39 -0
  121. httpp-0.9.0/docs/site/src/components/LangSwitch.module.css +34 -0
  122. httpp-0.9.0/docs/site/src/components/LangSwitch.tsx +24 -0
  123. httpp-0.9.0/docs/site/src/components/Only.tsx +8 -0
  124. httpp-0.9.0/docs/site/src/css/custom.css +46 -0
  125. httpp-0.9.0/docs/site/src/theme/NavbarItem/ComponentTypes.tsx +7 -0
  126. httpp-0.9.0/docs/site/src/theme/Root.tsx +6 -0
  127. httpp-0.9.0/docs/site/static/img/favicon.svg +1 -0
  128. httpp-0.9.0/docs/site/tsconfig.json +8 -0
  129. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/client.hpp +100 -99
  130. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/curl.hpp +3 -4
  131. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/curl_compat.h +1 -1
  132. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/download.hpp +8 -6
  133. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/export.hpp +5 -1
  134. httpp-0.9.0/include/httpp/file_browser.hpp +70 -0
  135. httpp-0.9.0/include/httpp/log.hpp +51 -0
  136. httpp-0.9.0/include/httpp/logging.hpp +334 -0
  137. httpp-0.9.0/include/httpp/middleware.hpp +104 -0
  138. httpp-0.9.0/include/httpp/path.hpp +152 -0
  139. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/router.hpp +13 -1
  140. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/server.hpp +57 -19
  141. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/sha256.hpp +2 -1
  142. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/swagger_ui.hpp +19 -7
  143. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/url.hpp +17 -1
  144. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/websocket.hpp +5 -5
  145. {httpp-0.8.0 → httpp-0.9.0}/include/httpp.h +1 -1
  146. {httpp-0.8.0 → httpp-0.9.0}/pyproject.toml +0 -1
  147. httpp-0.9.0/src/assets/file_browser.html +376 -0
  148. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/CMakeLists.txt +2 -2
  149. httpp-0.9.0/src/bindings/python/cy/async_routes.pxi +509 -0
  150. httpp-0.9.0/src/bindings/python/cy/client.pxi +308 -0
  151. httpp-0.9.0/src/bindings/python/cy/declarations.pxi +346 -0
  152. httpp-0.9.0/src/bindings/python/cy/directory.pxi +53 -0
  153. httpp-0.9.0/src/bindings/python/cy/file_browser.pxi +116 -0
  154. httpp-0.9.0/src/bindings/python/cy/request.pxi +280 -0
  155. httpp-0.9.0/src/bindings/python/cy/server.pxi +269 -0
  156. httpp-0.9.0/src/bindings/python/cy/support.pxi +222 -0
  157. httpp-0.9.0/src/bindings/python/cy/swagger_ui.pxi +41 -0
  158. httpp-0.9.0/src/bindings/python/cy/transfer.pxi +509 -0
  159. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/__init__.py +6 -6
  160. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_http.py +4 -2
  161. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_log.py +15 -0
  162. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_params.py +12 -5
  163. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_router.py +24 -0
  164. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_run.py +96 -7
  165. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/middleware.py +19 -0
  166. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/server.py +59 -20
  167. httpp-0.9.0/src/bindings/python/httpp/testclient.py +656 -0
  168. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/utils.py +4 -3
  169. httpp-0.9.0/src/bindings/python/httpp_cy.pyx +34 -0
  170. {httpp-0.8.0 → httpp-0.9.0}/src/cli/httpp_cli.cpp +57 -45
  171. {httpp-0.8.0 → httpp-0.9.0}/src/core/async_http.cpp +157 -9
  172. {httpp-0.8.0 → httpp-0.9.0}/src/core/async_server.cpp +28 -3
  173. httpp-0.9.0/src/core/client.cpp +363 -0
  174. httpp-0.9.0/src/core/curl.cpp +51 -0
  175. {httpp-0.8.0 → httpp-0.9.0}/src/core/curl_compat.cpp +3 -3
  176. httpp-0.9.0/src/core/download.cpp +520 -0
  177. {httpp-0.8.0 → httpp-0.9.0}/src/core/file_browser.cpp +78 -121
  178. {httpp-0.8.0 → httpp-0.9.0}/src/core/form.cpp +1 -1
  179. httpp-0.9.0/src/core/http_exchange.cpp +314 -0
  180. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/async_http.hpp +38 -2
  181. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/async_server.hpp +5 -1
  182. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/content_decode.hpp +1 -1
  183. httpp-0.9.0/src/core/internal/http_exchange.hpp +143 -0
  184. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/log.hpp +2 -2
  185. httpp-0.9.0/src/core/internal/logging_os.hpp +196 -0
  186. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/response_compression.hpp +1 -1
  187. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/tls_session.hpp +1 -1
  188. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/websocket.hpp +1 -0
  189. httpp-0.9.0/src/core/log.cpp +151 -0
  190. httpp-0.9.0/src/core/logging.cpp +569 -0
  191. httpp-0.9.0/src/core/logging_os.cpp +244 -0
  192. {httpp-0.8.0 → httpp-0.9.0}/src/core/middleware.cpp +195 -28
  193. httpp-0.9.0/src/core/path.cpp +247 -0
  194. {httpp-0.8.0 → httpp-0.9.0}/src/core/response_compression.cpp +1 -1
  195. {httpp-0.8.0 → httpp-0.9.0}/src/core/router.cpp +11 -0
  196. {httpp-0.8.0 → httpp-0.9.0}/src/core/server.cpp +232 -75
  197. {httpp-0.8.0 → httpp-0.9.0}/src/core/sha256.cpp +4 -4
  198. {httpp-0.8.0 → httpp-0.9.0}/src/core/swagger_ui.cpp +20 -6
  199. {httpp-0.8.0 → httpp-0.9.0}/src/core/tls_session.cpp +8 -7
  200. {httpp-0.8.0 → httpp-0.9.0}/src/core/url.cpp +14 -1
  201. {httpp-0.8.0 → httpp-0.9.0}/src/core/websocket.cpp +5 -0
  202. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/README.md +9 -19
  203. {httpp-0.8.0 → httpp-0.9.0}/tests/cmake/consumer_project/main.cpp +6 -6
  204. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/CMakeLists.txt +2 -3
  205. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_async_http.cpp +6 -6
  206. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_async_pool_proxy.cpp +263 -0
  207. httpp-0.9.0/tests/cpp/test_async_stream.cpp +155 -0
  208. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_client.cpp +1 -1
  209. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_client_async_engine.cpp +42 -42
  210. httpp-0.9.0/tests/cpp/test_client_blocking_engine.cpp +123 -0
  211. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_client_encoding.cpp +25 -25
  212. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_client_request.cpp +10 -10
  213. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_client_session.cpp +23 -23
  214. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_curl.cpp +5 -5
  215. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_curl_compat.cpp +1 -1
  216. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_download.cpp +9 -9
  217. httpp-0.9.0/tests/cpp/test_download_transfer.cpp +182 -0
  218. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_file_browser.cpp +204 -57
  219. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_form.cpp +4 -4
  220. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_log.cpp +18 -3
  221. httpp-0.9.0/tests/cpp/test_logging_module.cpp +445 -0
  222. httpp-0.9.0/tests/cpp/test_logging_os.cpp +176 -0
  223. httpp-0.9.0/tests/cpp/test_mime.cpp +27 -0
  224. httpp-0.9.0/tests/cpp/test_path.cpp +266 -0
  225. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_router.cpp +30 -3
  226. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server.cpp +21 -21
  227. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_after_send.cpp +6 -6
  228. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_compression.cpp +6 -6
  229. httpp-0.9.0/tests/cpp/test_server_conditional.cpp +231 -0
  230. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_features.cpp +38 -38
  231. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_io_routes.cpp +40 -40
  232. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_io_threads.cpp +37 -18
  233. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_middleware.cpp +103 -46
  234. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_routing.cpp +1 -1
  235. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_shutdown.cpp +56 -6
  236. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_tls.cpp +11 -11
  237. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_server_websocket.cpp +12 -12
  238. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_swagger_ui_route.cpp +8 -8
  239. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_url.cpp +25 -0
  240. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_websocket_session.cpp +25 -0
  241. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/ws_test_client.hpp +2 -0
  242. httpp-0.9.0/tests/python/test_builders.py +168 -0
  243. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_cli.py +30 -0
  244. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_cpp_python_parity.py +34 -16
  245. httpp-0.9.0/tests/python/test_file_browser.py +234 -0
  246. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_httpp_basic.py +28 -0
  247. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_httpp_routes.py +24 -2
  248. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_io_threads.py +15 -3
  249. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_log.py +12 -0
  250. httpp-0.9.0/tests/python/test_pathlib.py +84 -0
  251. httpp-0.9.0/tests/python/test_portability_sources.py +21 -0
  252. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_responses.py +37 -0
  253. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_run.py +184 -3
  254. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_shutdown.py +59 -0
  255. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_testclient.py +186 -0
  256. httpp-0.9.0/tests/python/test_websocket_router.py +320 -0
  257. httpp-0.8.0/benchmarks/.gitignore +0 -1
  258. httpp-0.8.0/include/httpp/file_browser.hpp +0 -34
  259. httpp-0.8.0/include/httpp/log.hpp +0 -31
  260. httpp-0.8.0/include/httpp/middleware.hpp +0 -54
  261. httpp-0.8.0/src/assets/file_browser.html +0 -185
  262. httpp-0.8.0/src/bindings/python/httpp/testclient.py +0 -361
  263. httpp-0.8.0/src/bindings/python/httpp_cy.pyx +0 -2369
  264. httpp-0.8.0/src/core/client.cpp +0 -807
  265. httpp-0.8.0/src/core/curl.cpp +0 -115
  266. httpp-0.8.0/src/core/download.cpp +0 -610
  267. httpp-0.8.0/src/core/internal/httplib_common.hpp +0 -36
  268. httpp-0.8.0/src/core/log.cpp +0 -107
  269. httpp-0.8.0/src/third_party/aixlog/LICENSE +0 -21
  270. httpp-0.8.0/src/third_party/aixlog/aixlog.hpp +0 -1254
  271. httpp-0.8.0/src/third_party/cpp-httplib/httplib.h +0 -22669
  272. httpp-0.8.0/tests/python/test_file_browser.py +0 -124
  273. {httpp-0.8.0 → httpp-0.9.0}/.github/workflows/autobahn.yml +0 -0
  274. {httpp-0.8.0 → httpp-0.9.0}/.github/workflows/cmake.yml +0 -0
  275. {httpp-0.8.0 → httpp-0.9.0}/.github/workflows/release_template.md +0 -0
  276. {httpp-0.8.0 → httpp-0.9.0}/.github/workflows/wheels.yml +0 -0
  277. {httpp-0.8.0 → httpp-0.9.0}/.gitmodules +0 -0
  278. {httpp-0.8.0 → httpp-0.9.0}/LICENSE.txt +0 -0
  279. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/asgi_app.py +0 -0
  280. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/bench_validate.py +0 -0
  281. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/cpp/drogon_bench.cpp +0 -0
  282. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/cpp/ws_load.cpp +0 -0
  283. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/cpu_app.py +0 -0
  284. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/diag_io.sh +0 -0
  285. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/fastapi_app.py +0 -0
  286. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/httpp_app.py +0 -0
  287. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/io_app.py +0 -0
  288. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/stress.py +0 -0
  289. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/suite_asgi.py +0 -0
  290. {httpp-0.8.0 → httpp-0.9.0}/benchmarks/ws_websockets.py +0 -0
  291. {httpp-0.8.0 → httpp-0.9.0}/cmake/DynamicVersion.cmake +0 -0
  292. {httpp-0.8.0 → httpp-0.9.0}/cmake/EmbedFile.cmake +0 -0
  293. {httpp-0.8.0 → httpp-0.9.0}/cmake/FindCython.cmake +0 -0
  294. {httpp-0.8.0 → httpp-0.9.0}/cmake/Optimize.cmake +0 -0
  295. {httpp-0.8.0 → httpp-0.9.0}/cmake/Startup.cmake +0 -0
  296. {httpp-0.8.0 → httpp-0.9.0}/cmake/UseCython.cmake +0 -0
  297. {httpp-0.8.0 → httpp-0.9.0}/cmake/httppConfig.cmake.in +0 -0
  298. {httpp-0.8.0 → httpp-0.9.0}/cmake/httpp_mbedtls_config.h +0 -0
  299. {httpp-0.8.0 → httpp-0.9.0}/cmake/utils/embedded_files.in.hpp +0 -0
  300. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0001-own-both-layers.md +0 -0
  301. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0002-standard-asyncio-loop.md +0 -0
  302. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0004-zero-system-dependencies.md +0 -0
  303. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0006-own-model-layer.md +0 -0
  304. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0007-openapi-from-one-plan.md +0 -0
  305. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0008-swagger-ui-compiled-in.md +0 -0
  306. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0009-hot-path.md +0 -0
  307. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0010-mbedtls-threading.md +0 -0
  308. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0012-run-wins-over-listen.md +0 -0
  309. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0013-packaging.md +0 -0
  310. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0014-coding-conventions.md +0 -0
  311. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0015-testing-and-ci.md +0 -0
  312. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0016-hybrid-api-parity.md +0 -0
  313. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0017-python-binding-policy.md +0 -0
  314. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0018-python-logging-bridge.md +0 -0
  315. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0019-vendored-deflate-inflate.md +0 -0
  316. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0020-http-exception-and-response-classes.md +0 -0
  317. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0021-pool-thread-state-and-two-core-numbers.md +0 -0
  318. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0022-dual-api-rule-and-delegated-decisions.md +0 -0
  319. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0023-inline-async-handlers.md +0 -0
  320. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0024-io-threads-and-lanes.md +0 -0
  321. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0025-measured-defaults-on-16-threads.md +0 -0
  322. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0026-websocket.md +0 -0
  323. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0027-websocket-python-and-async-handshake.md +0 -0
  324. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0028-autobahn-called-by-the-orchestrator.md +0 -0
  325. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0029-incremental-utf8-validation.md +0 -0
  326. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0030-benchmarks-built-by-cmake.md +0 -0
  327. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0031-compressed-embedded-files.md +0 -0
  328. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0033-engine-per-request-cost.md +0 -0
  329. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0034-balanced-connections-between-io-threads.md +0 -0
  330. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0035-hook-path-needs-no-server-pointer.md +0 -0
  331. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0036-connection-read-buffer-not-zero-filled.md +0 -0
  332. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0038-graceful-shutdown.md +0 -0
  333. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0039-reload-supervisor.md +0 -0
  334. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0040-server-tls.md +0 -0
  335. {httpp-0.8.0 → httpp-0.9.0}/docs/adr/0041-native-cli-and-py.md +0 -0
  336. {httpp-0.8.0 → httpp-0.9.0}/docs/index.rst +0 -0
  337. {httpp-0.8.0 → httpp-0.9.0}/examples/find_httpp_via_python/CMakeLists.txt +0 -0
  338. {httpp-0.8.0 → httpp-0.9.0}/examples/find_httpp_via_python/main.cpp +0 -0
  339. {httpp-0.8.0 → httpp-0.9.0}/examples/python/01_hello_server.py +0 -0
  340. {httpp-0.8.0 → httpp-0.9.0}/examples/python/02_path_params.py +0 -0
  341. {httpp-0.8.0 → httpp-0.9.0}/examples/python/03_request_object.py +0 -0
  342. {httpp-0.8.0 → httpp-0.9.0}/examples/python/04_responses.py +0 -0
  343. {httpp-0.8.0 → httpp-0.9.0}/examples/python/05_http_methods.py +0 -0
  344. {httpp-0.8.0 → httpp-0.9.0}/examples/python/06_async_handlers.py +0 -0
  345. {httpp-0.8.0 → httpp-0.9.0}/examples/python/07_serve_directory.py +0 -0
  346. {httpp-0.8.0 → httpp-0.9.0}/examples/python/08_error_handling.py +0 -0
  347. {httpp-0.8.0 → httpp-0.9.0}/examples/python/09_client.py +0 -0
  348. {httpp-0.8.0 → httpp-0.9.0}/examples/python/10_request_builder.py +0 -0
  349. {httpp-0.8.0 → httpp-0.9.0}/examples/python/11_download.py +0 -0
  350. {httpp-0.8.0 → httpp-0.9.0}/examples/python/12_hooks_and_settings.py +0 -0
  351. {httpp-0.8.0 → httpp-0.9.0}/examples/python/13_streaming_and_files.py +0 -0
  352. {httpp-0.8.0 → httpp-0.9.0}/examples/python/14_async_client.py +0 -0
  353. {httpp-0.8.0 → httpp-0.9.0}/examples/python/15_progress_and_url.py +0 -0
  354. {httpp-0.8.0 → httpp-0.9.0}/include/httpp/progress.hpp +0 -0
  355. {httpp-0.8.0 → httpp-0.9.0}/requirements-dev.txt +0 -0
  356. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/_validate_cy.pyx +0 -0
  357. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/__main__.py +0 -0
  358. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_background.py +0 -0
  359. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_forms.py +0 -0
  360. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_reload.py +0 -0
  361. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_schema.py +0 -0
  362. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_validate.py +0 -0
  363. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/_websocket.py +0 -0
  364. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/errors.py +0 -0
  365. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/models.py +0 -0
  366. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/progress.py +0 -0
  367. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/responses.py +0 -0
  368. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp/status.py +0 -0
  369. {httpp-0.8.0 → httpp-0.9.0}/src/bindings/python/httpp_cli.py +0 -0
  370. {httpp-0.8.0 → httpp-0.9.0}/src/core/content_decode.cpp +0 -0
  371. {httpp-0.8.0 → httpp-0.9.0}/src/core/deflate.cpp +0 -0
  372. {httpp-0.8.0 → httpp-0.9.0}/src/core/inflate.cpp +0 -0
  373. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/blocking_pool.hpp +0 -0
  374. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/checksums.hpp +0 -0
  375. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/deflate.hpp +0 -0
  376. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/inflate.hpp +0 -0
  377. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/urlencoded.hpp +0 -0
  378. {httpp-0.8.0 → httpp-0.9.0}/src/core/internal/worker_pool.hpp +0 -0
  379. {httpp-0.8.0 → httpp-0.9.0}/src/core/mbedtls_alt/threading_alt.h +0 -0
  380. {httpp-0.8.0 → httpp-0.9.0}/src/core/mbedtls_threading.cpp +0 -0
  381. {httpp-0.8.0 → httpp-0.9.0}/src/core/progress.cpp +0 -0
  382. {httpp-0.8.0 → httpp-0.9.0}/src/core/websocket_api.cpp +0 -0
  383. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/CLI11/CLI11.hpp +0 -0
  384. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/indicators/indicators.hpp +0 -0
  385. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/llhttp/LICENSE +0 -0
  386. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/llhttp/VENDORED.md +0 -0
  387. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/llhttp/include/llhttp.h +0 -0
  388. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/llhttp/src/api.c +0 -0
  389. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/llhttp/src/http.c +0 -0
  390. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/llhttp/src/llhttp.c +0 -0
  391. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/stb_deflate/LICENSE +0 -0
  392. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/stb_deflate/VENDORED.md +0 -0
  393. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/stb_deflate/stb_deflate.h +0 -0
  394. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/stb_inflate/LICENSE +0 -0
  395. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/stb_inflate/VENDORED.md +0 -0
  396. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/stb_inflate/stb_inflate.h +0 -0
  397. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/swagger-ui/LICENSE +0 -0
  398. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/swagger-ui/NOTICE +0 -0
  399. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/swagger-ui/VENDORED.md +0 -0
  400. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/swagger-ui/swagger-api-icon.svg +0 -0
  401. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/swagger-ui/swagger-ui-bundle.js +0 -0
  402. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/swagger-ui/swagger-ui-bundle.js.LICENSE.txt +0 -0
  403. {httpp-0.8.0 → httpp-0.9.0}/src/third_party/swagger-ui/swagger-ui.css +0 -0
  404. {httpp-0.8.0 → httpp-0.9.0}/tests/CMakeLists.txt +0 -0
  405. {httpp-0.8.0 → httpp-0.9.0}/tests/cmake/CMakeLists.txt +0 -0
  406. {httpp-0.8.0 → httpp-0.9.0}/tests/cmake/consumer_project/CMakeLists.txt +0 -0
  407. {httpp-0.8.0 → httpp-0.9.0}/tests/cmake/embed_compress/CMakeLists.txt +0 -0
  408. {httpp-0.8.0 → httpp-0.9.0}/tests/cmake/embed_compress/main.cpp +0 -0
  409. {httpp-0.8.0 → httpp-0.9.0}/tests/cmake/run_consumer_test.cmake +0 -0
  410. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/inflate_fixtures.hpp +0 -0
  411. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/local_server.hpp +0 -0
  412. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/swagger_original.hpp +0 -0
  413. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_async_https.cpp +0 -0
  414. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_async_server.cpp +0 -0
  415. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_certs.hpp +0 -0
  416. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_deflate.cpp +0 -0
  417. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_inflate.cpp +0 -0
  418. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_progress.cpp +0 -0
  419. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_sha256.cpp +0 -0
  420. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_swagger_ui.cpp +0 -0
  421. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/test_worker_pool.cpp +0 -0
  422. {httpp-0.8.0 → httpp-0.9.0}/tests/cpp/tls_test_server.hpp +0 -0
  423. {httpp-0.8.0 → httpp-0.9.0}/tests/python/CMakeLists.txt +0 -0
  424. {httpp-0.8.0 → httpp-0.9.0}/tests/python/conftest.py +0 -0
  425. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_abi3_safe.py +0 -0
  426. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_async_engine.py +0 -0
  427. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_cli_path.py +0 -0
  428. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_client.py +0 -0
  429. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_client_encoding.py +0 -0
  430. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_client_keep_alive.py +0 -0
  431. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_download_progress_url.py +0 -0
  432. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_download_sha256.py +0 -0
  433. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_embed_file.py +0 -0
  434. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_examples.py +0 -0
  435. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_forms.py +0 -0
  436. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_inline_async.py +0 -0
  437. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_log_bridge.py +0 -0
  438. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_middleware.py +0 -0
  439. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_models_vs_pydantic.py +0 -0
  440. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_openapi.py +0 -0
  441. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_params_depends.py +0 -0
  442. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_path_templates.py +0 -0
  443. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_pool_thread_state.py +0 -0
  444. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_query_encoding.py +0 -0
  445. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_reload.py +0 -0
  446. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_response_injection.py +0 -0
  447. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_router.py +0 -0
  448. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_server_features.py +0 -0
  449. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_server_raw_request.py +0 -0
  450. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_tls.py +0 -0
  451. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_validate_vs_pydantic.py +0 -0
  452. {httpp-0.8.0 → httpp-0.9.0}/tests/python/test_websocket.py +0 -0
  453. {httpp-0.8.0 → httpp-0.9.0}/tests/utest/utest.h +0 -0
  454. {httpp-0.8.0 → httpp-0.9.0}/tests/utest/utest_main.cxx +0 -0
  455. {httpp-0.8.0 → httpp-0.9.0}/tools/autobahn/README.md +0 -0
  456. {httpp-0.8.0 → httpp-0.9.0}/tools/autobahn/check_report.py +0 -0
  457. {httpp-0.8.0 → httpp-0.9.0}/tools/autobahn/echo_server.py +0 -0
  458. {httpp-0.8.0 → httpp-0.9.0}/tools/autobahn/fuzzingclient.json +0 -0
  459. {httpp-0.8.0 → httpp-0.9.0}/tools/fastapi_probes/probe_fastapi_deps_responses.py +0 -0
  460. {httpp-0.8.0 → httpp-0.9.0}/tools/fastapi_probes/probe_fastapi_params.py +0 -0
  461. {httpp-0.8.0 → httpp-0.9.0}/tools/fastapi_probes/probe_pydantic_types.py +0 -0
  462. {httpp-0.8.0 → httpp-0.9.0}/version.py +0 -0
@@ -0,0 +1,47 @@
1
+ name: docs
2
+
3
+ # Builds the documentation site in docs/site (ADR-0060). The orchestrator calls it on every push to master and on tags; it is
4
+ # informational there (release-wheels does not wait for it). On pull requests it runs only when the site changes. Publishes nothing.
5
+ on:
6
+ workflow_dispatch:
7
+ workflow_call:
8
+ pull_request:
9
+ branches: [ master ]
10
+ paths:
11
+ - "docs/site/**"
12
+ - ".github/workflows/docs.yml"
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ site:
19
+ runs-on: ubuntu-latest
20
+ defaults:
21
+ run:
22
+ working-directory: docs/site
23
+ steps:
24
+ - uses: actions/checkout@v6
25
+ with:
26
+ submodules: recursive
27
+ - uses: actions/setup-python@v6
28
+ with:
29
+ python-version: "3.12"
30
+ - uses: actions/setup-node@v6
31
+ with:
32
+ node-version: "22"
33
+ cache: npm
34
+ cache-dependency-path: docs/site/package-lock.json
35
+ - name: Both languages have every snippet
36
+ run: python3 scripts/prepare.py all
37
+ - name: Build and install httpp
38
+ working-directory: .
39
+ run: pip install .
40
+ - name: Snippets build, run and do what their pages say
41
+ run: python3 scripts/test_snippets.py
42
+ - name: Install
43
+ run: npm ci
44
+ - name: Type check
45
+ run: npm run typecheck
46
+ - name: Build
47
+ run: npm run build
@@ -63,6 +63,12 @@ jobs:
63
63
  permissions:
64
64
  contents: write
65
65
 
66
+ # Runs after the cmake job, so the docs are built only against a library that built and passed its tests. Informational:
67
+ # release-wheels does not wait for it, a broken docs build must not block publishing the wheels (ADR-0060).
68
+ docs:
69
+ uses: ./.github/workflows/docs.yml
70
+ needs: [init, cmake]
71
+
66
72
  release-wheels:
67
73
  needs: [wheel, init]
68
74
  runs-on: ubuntu-latest
@@ -0,0 +1,61 @@
1
+ name: pages
2
+
3
+ # Publishes the documentation site (docs/site, ADR-0064) to GitHub Pages: https://mohammadraziei.github.io/httpp/
4
+ # docs.yml checks the site (snippets, type check, build) and publishes nothing; this workflow builds it again and deploys it.
5
+ # It is a workflow of its own, not a job of docs.yml: the orchestrator calls docs.yml, and a called workflow cannot ask for
6
+ # more permissions than its caller gives.
7
+ # One-time setup: Settings -> Pages -> Source: "GitHub Actions".
8
+ on:
9
+ workflow_dispatch:
10
+ push:
11
+ branches: [ master ]
12
+ paths:
13
+ - "docs/site/**"
14
+ - "benchmarks/results/full/*.json"
15
+ - ".github/workflows/pages.yml"
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ concurrency:
21
+ group: pages
22
+ cancel-in-progress: true
23
+
24
+ jobs:
25
+ build:
26
+ runs-on: ubuntu-latest
27
+ defaults:
28
+ run:
29
+ working-directory: docs/site
30
+ steps:
31
+ - uses: actions/checkout@v6
32
+ - uses: actions/setup-python@v6
33
+ with:
34
+ python-version: "3.12"
35
+ - uses: actions/setup-node@v6
36
+ with:
37
+ node-version: "22"
38
+ cache: npm
39
+ cache-dependency-path: docs/site/package-lock.json
40
+ - name: Snippets and benchmark data
41
+ run: python3 scripts/prepare.py all
42
+ - name: Install
43
+ run: npm ci
44
+ - name: Build
45
+ run: npm run build
46
+ - uses: actions/upload-pages-artifact@v3
47
+ with:
48
+ path: docs/site/build
49
+
50
+ deploy:
51
+ needs: build
52
+ runs-on: ubuntu-latest
53
+ permissions:
54
+ pages: write
55
+ id-token: write
56
+ environment:
57
+ name: github-pages
58
+ url: ${{ steps.deployment.outputs.page_url }}
59
+ steps:
60
+ - id: deployment
61
+ uses: actions/deploy-pages@v4
@@ -134,4 +134,6 @@ ehthumbs.db
134
134
  Thumbs.db
135
135
 
136
136
  # Build directory
137
- *build*/
137
+ *build*/
138
+ # local benchmark build tree (benchmarks/CMakeLists.txt, ADR-0030)
139
+ build-bench/
@@ -7,9 +7,66 @@ such changes are listed under **Changed**).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.0] - 2026-11-14
11
+
12
+ ### Added
13
+
14
+ - **File browser page (ADR-0032).** Audio and video previews use the page's own controls instead of the browser's: they follow the light, dark and accent settings and add seek with buffered range, volume, speed, full screen for video, keyboard keys, and previous and next through the files of the folder. Download, Open raw and Close are icon buttons with tooltips at the top right, the dialog is a little larger, opens and closes with a short animation, and closes on a click outside, Escape or the Close button. Files get an icon by kind (image, audio, video, PDF, archive, text, other) and the list view has a Type column that can be sorted. No API change.
15
+
16
+ - **The file browser shows html and svg (ADR-0070).** "Open raw" now renders them in the tab it opens, and the dialog shows an svg as an image (html stays text there), always behind `Content-Security-Policy: sandbox; default-src 'none'; ...`, so no script runs and nothing outside the server is fetched. xml, js and unknown types stay downloads. **This changes the default:** before, html and svg were always downloads. `file_browser::set_safe_mode(true)` (Python `FileBrowser.set_safe_mode` / `safe_mode=True`, `httpp browse --safe`) brings the old behaviour back. `httpp::directory` gains `set_inline_active(bool)` (Python `Directory.set_inline_active` / `inline_active=`), which does the same for a mounted folder together with `set_download_active(true)`. A `download_active` answer (the file browser's `/raw`, or a directory with `set_download_active(true)`) now carries `Cache-Control: no-cache` and an ETag that follows how the file is sent, so changing the mode is never hidden by a browser's cached copy.
17
+
18
+ ### Changed
19
+
20
+ - **`httpp server` and `httpp browse` log (ADR-0011).** They printed nothing after the first line. Now, as `httpp py run`, they write `listening on http://host:port` and one line per request (`GET /a.mp3 200`) to stderr; `--log-level` (`trace`, `debug`, `info`, `warning`, `error`, `off`) changes it, and `--log-level off` is the old silent behaviour. The library's own default (`listen()` at `warning`) is unchanged.
21
+ - **C++ names now match Python's (ADR-0062, breaking for C++ code).** `httpp::request` is the client builder, as `httpp.Request` is, and the request a server handler receives is `httpp::server_request`, as `httpp.ServerRequest` is. Before, the handler's request was `httpp::request` and the builder was `httpp::client::request` (removed, no alias). Rename `const httpp::request&` to `const httpp::server_request&` in your handlers and `httpp::client::request` to `httpp::request`. Python code is unchanged.
22
+ - **File browser API** (ADR-0065): C++ `httpp::file_browser_options` and `httpp::mount_file_browser(...)` are replaced by the class `httpp::file_browser(root).set_title(...).set_theme(file_browser::theme_mode::dark)...mount(server, "/files")`; theme, view and sort are enums (`theme_mode`, `view_mode`, `sort_key`) instead of strings, and a bad accent or `max_entries` throws at the setter. Python gets the same design: `httpp.FileBrowser(root, ...)` with chained `set_*` methods, `FileBrowser.Theme/View/Sort` enums and `mount(server, base)`; `Server.mount_file_browser(...)` is removed. `httpp browse` is unchanged.
23
+ - **Builder classes for the remaining option structs (ADR-0066, breaking for C++ code).** `httpp::add_cors`, `add_trusted_host`, `add_https_redirect` and their option structs are replaced by `httpp::cors`, `trusted_host` and `https_redirect` (chained `set_*`, then `install(server&)`); `server::directory_options` and the three-argument `serve_directory` by `httpp::directory(root).set_index(...).set_show_hidden(...).set_download_active(...).mount(server, base)` (`hidden` is now `show_hidden`); `mount_swagger_ui` by `httpp::swagger_ui().set_docs_path(...).set_openapi_url(...).set_title(...).mount(server)`. Python gains `httpp.Directory` and `httpp.SwaggerUI`; `Server.mount_swagger_ui` is removed. Bad values are refused at the setter.
24
+ - **URLs and proxies (ADR-0067, breaking).** Every C++ function that needs a URL takes an `httpp::url`, which converts implicitly from a string or literal (`client`, `async_client`, `client::fetch`, `request`, `download`, `sha256_url`); `url` gains `str()`, `username()` and `password()` (Python `URL` too). A proxy is one URL, `set_proxy("http://user:pass@127.0.0.1:3128")` in C++ and `proxy="http://user:pass@127.0.0.1:3128"` in Python, and the credentials are now sent as `Proxy-Authorization`. The `(host, port)` forms and the Python tuple are removed.
25
+ - **SOCKS5 proxy (ADR-0068).** `set_proxy("socks5h://user:pass@127.0.0.1:1080")` (or `socks5://`, local DNS) in C++ and `proxy="..."` in Python; works for http and https targets. `httpp::url` parses the two schemes and gains `is_http()` (Python `URL.is_http`); a socks URL is a proxy address and is refused as a target.
26
+ - **Client address and reverse proxies (ADR-0069).** `server_request::client_ip` / `request.client_ip` (the address of the connection, `""` when unknown). `httpp::forwarded_headers` / `ProxyHeadersMiddleware`: when the connection comes from a trusted proxy (`set_trusted_proxies`, default loopback; addresses, CIDR ranges or `*`), `client_ip` comes from `X-Forwarded-For` (first untrusted address from the right), `secure` from `X-Forwarded-Proto`, and `Host` from `X-Forwarded-Host` with `set_trust_forwarded_host(true)`.
27
+ - On a free-threaded Python the default worker pool starts at 2 threads instead of `max(8, CPUs)`, grows after a 2 ms wait and still reaches the old ceiling (ADR-0059): CPU-bound `def` handlers measured 68.2k against 58.2k req/s at one I/O thread (3.14t, 16 threads). Builds with a GIL are unchanged.
28
+
29
+ ### Fixed
30
+
31
+ - **`AsyncClient` and `Request.run_async` on free-threaded Python.** The completion callback ran on the C++ network thread without pinning a thread state, so every request created and destroyed one (`PyGILState_Ensure`/`Release`), which is very slow on 3.14t: in the 0.8.1 benchmark `AsyncClient` made 33,842 req/s on 3.14 and 2,426 on 3.14t (32 tasks). The server trampolines already had this fix.
32
+ - **HTTP client connection pool (ADR-0071).** The engine kept at most 8 idle connections per origin and closed the rest, so with more than 8 requests in flight (`Client` from 16 or 32 threads on a free-threaded Python, `AsyncClient` with 32 tasks) every burst reopened its extra connections. The limit is now 256. With both fixes (`benchmarks/run.sh full` on the owner's machine, i7-13620H, governor `performance`, 32 threads or tasks), 3.14t: `Client` 28,438 to 152,873 req/s, `AsyncClient` 57,634 (after the thread-state fix alone) to 113,747; on 3.14 (GIL) the same run gives 92,811 and 61,433. Test: `async_pool.a_burst_larger_than_eight_keeps_all_its_connections_for_the_next_burst`.
33
+ - **`benchmarks/run.sh` keeps no options between runs.** The `BENCH_*` options are CMake cache variables, so `run.sh full -DBENCH_ONLY=client` made every later `run.sh full` run only the client part too. `run.sh` now drops the cached `BENCH_*` values first (`-UBENCH_*`): an option applies to the run that passes it.
34
+
35
+ ## [0.8.1] - 2026-11-11
36
+
10
37
  ### Added
11
38
 
12
- - **`httpp.testclient.TestClient`** (ADR-0042): a Starlette-shaped client for testing your app. It serves the app on a free loopback port of its own and goes through httpp's client, so tests meet the real routing, middleware and error paths. Cookies, redirects, `base_url`/`Host`, `raise_server_exceptions`, startup and shutdown hooks (`with TestClient(app)`). Not yet: `websocket_connect`, multipart `files=`, an in-memory mode.
39
+ - The file system module is part of `httpp::path` (ADR-0058): `stat`, `lstat`, `resolve`, `is_relative_to`, `iterdir`, `rmdir`, `is_executable` are members next to `exists`, `mkdir`, `unlink`, `rename`; there is no separate `httpp::fs` any more. `mkdir()` is now true only when this call created the directory.
40
+ - **`httpp/logging.hpp` is public** (ADR-0057): the Python-shaped logging module httpp logs through (`get_logger`, `logger`, `formatter`, `stream/file/callback/null_handler`, your own `handler` subclass) is installed and exported. The "httpp" logger can take extra handlers. Python keeps using its standard `logging`.
41
+ - **`set_log_system`** (ADR-0056, C++ and Python): send the library log to the operating system's log: syslog, logcat, Apple unified logging, Windows debugger output or the Event Log (`"native"` picks the platform's usual one). Ported from libstb.
42
+ - **`httpp::path`** (ADR-0055, `httpp/path.hpp`): a pathlib-shaped path type for C++ (`/`, `name`, `stem`, `suffix`, `parent`, `exists`, `open`, `read_text`, `path::cwd()`, `as_uri`, ...). The public API that names a file takes it (strings still convert): `download`, `sha256_file`, `set_log_file`, `set_ca_file`, `set_tls`, `mount_file_browser`, `response::file`. In Python every path argument now also takes a `pathlib.Path`.
43
+
44
+ ### Fixed
45
+
46
+ - **No more `std::filesystem` anywhere in the library or the CLI** (ADR-0054): an internal `httpp::fs` module (merged into `httpp::path` by ADR-0058) (POSIX calls, the wide Win32 API on Windows, UTF-8 paths) is used by downloads, the file browser, static files, the logging module, TLS certificate loading, `sha256_file` and the CLI. This removes the macOS 10.13 build break and five private copies of the same operations. On Windows, non-ASCII file names now work in all of them.
47
+ - **macOS wheel build:** the internal logging module's `file_handler` took a `std::filesystem::path`, which the macOS 10.13 target does not have (CI failed in `log.cpp`). It takes a UTF-8 `std::string` now (converted to UTF-16 on Windows, so a non-ASCII log path works there too), and `tests/python/test_portability_sources.py` fails on any `std::filesystem` outside an `_WIN32` block.
48
+ - **Python log bridge at interpreter exit:** the C++ trampoline checks `Py_IsInitialized()` before taking the GIL and an `atexit` hook hands the log back to stderr, so a library thread that logs late cannot reach a dying interpreter (the same fix libstb made for its bridge).
49
+
50
+ ### Changed
51
+
52
+ - **cpp-httplib is removed** (ADR-0052, ADR-0053). Downloads now stream through a body sink on a dedicated engine (the destination file is created only for an accepted status; a Range reply of 200 restarts the file), `httpp.curl` is a thin face on `client.request`, and the vendored `httplib.h` is deleted. No public API change.
53
+ - **The blocking client runs on the async engine** (ADR-0051): `client`, `client::request::run` and `client::fetch` share one policy layer with `async_client` (redirects, auth, cookies, proxy, TLS). A `client` can now be shared between threads without taking turns, connections are pooled across clients, a blocking call from an async callback returns an error instead of deadlocking, and `async_client::set_header` replaces a same-name default. cpp-httplib now serves only downloads and the `curl` helper.
54
+ - **Logging no longer uses the vendored AixLog** (ADR-0050): the library logs through a small internal module ported from libstb (Python-shaped loggers, handlers and formatter, no dependency, no patch). `set_log_level`, `set_log_file`, `set_log_callback` are unchanged in C++ and Python; the default line is now `time [LEVEL] httpp (function): message`.
55
+ - The Cython module `httpp_cy.pyx` is split into `cy/*.pxi` files (textual includes, still one module and one extension; ADR-0049). No behaviour change.
56
+
57
+ ### Added
58
+
59
+ - **WebSocket routes on routers and `Depends` on WebSocket routes** (ADR-0048): `router::route_ws` and `@router.websocket(...)` join prefixes like HTTP routes; a Python WebSocket handler may use `Depends` (sync, async, `yield` cleanup, sub-dependencies). A failing dependency refuses the upgrade (`HTTPException` status, or 422); a dependency may take `websocket`.
60
+ - **WebSocket close 1001 on shutdown** (ADR-0043): `server.shutdown()` and SIGTERM now send each open WebSocket a close frame with code 1001 and wait for the peer's answer (up to the grace period) instead of dropping the connection; a handler sees a clean close.
61
+ - **Dead `--workers` are restarted** (ADR-0044): the supervisor starts a new worker at once the first time and with a growing wait after that (0.5, 1, 2, 4 seconds); a worker that keeps dying right after it starts stops the group with exit code 1. Workers also end when the supervisor is killed, even with SIGKILL (Linux).
62
+ - **`ETag`, `Last-Modified` and conditional requests for mounted files** (ADR-0045): `If-None-Match` and `If-Modified-Since` give 304, `If-Match` and `If-Unmodified-Since` give 412, `If-Range` decides whether a `Range` is honoured. This covers `serve_directory` and the file browser's raw route.
63
+ - **`httpp.testclient.TestClient`** (ADR-0042): a Starlette-shaped client for testing your app. It serves the app on a free loopback port of its own and goes through httpp's client, so tests meet the real routing, middleware and error paths. Cookies, redirects, `base_url`/`Host`, `raise_server_exceptions`, startup and shutdown hooks (`with TestClient(app)`). Also `files=` (multipart) and `websocket_connect` (ADR-0046). Not yet: an in-memory mode.
64
+
65
+ ### Fixed
66
+
67
+ - A 304 answer no longer carries `Content-Length: 0`.
68
+ - Python's `file()`, `FileResponse` and `TestClient(files=)` choose the Content-Type with the same table as mounted directories (ADR-0047), so `ico`, `gz`, `wav` and `yaml` no longer differ and nothing depends on the operating system's MIME registry. `yaml` and `yml` are now `application/yaml`.
69
+ - The async client no longer leaks the exchanges that were still waiting when the client was destroyed (a reference cycle, ADR-0047).
13
70
 
14
71
  ### Changed (breaking)
15
72
 
@@ -428,7 +485,9 @@ First release.
428
485
  - Single umbrella header `include/httpp.h` that carries the version, and `version.py` for tagging and releases.
429
486
  - CMake and wheels workflows in CI.
430
487
 
431
- [Unreleased]: https://github.com/MohammadRaziei/httpp/compare/v0.8.0...HEAD
488
+ [Unreleased]: https://github.com/MohammadRaziei/httpp/compare/v0.9.0...HEAD
489
+ [0.9.0]: https://github.com/MohammadRaziei/httpp/compare/v0.8.1...v0.9.0
490
+ [0.8.1]: https://github.com/MohammadRaziei/httpp/compare/v0.8.0...v0.8.1
432
491
  [0.8.0]: https://github.com/MohammadRaziei/httpp/compare/v0.7.0...v0.8.0
433
492
  [0.7.0]: https://github.com/MohammadRaziei/httpp/compare/v0.6.1...v0.7.0
434
493
  [0.6.1]: https://github.com/MohammadRaziei/httpp/compare/v0.6.0...v0.6.1
@@ -26,12 +26,11 @@ option(HTTPP_BUILD_PYTHON "Build Python bindings" ${PROJECT_IS_TOP_LEVEL})
26
26
  set(HTTPP_SOURCE_DIR ${PROJECT_SOURCE_DIR})
27
27
 
28
28
  # --- httpp C++ core ---
29
- # httplib.h is vendored at src/third_party/cpp-httplib (a real committed
30
- # file, no system package). mbedtls is a git submodule at
31
- # src/third_party/mbedtls (also built from source, no system package).
32
- # Both are included only from src/core/*.cpp, never from a public
33
- # include/httpp/*.hpp header, and are compiled with hidden visibility so
34
- # they never leak into the httpp .so/.a's public symbols.
29
+ # mbedtls is a git submodule at src/third_party/mbedtls (built from
30
+ # source, no system package). It is included only from src/core/*.cpp,
31
+ # never from a public include/httpp/*.hpp header, and is compiled with
32
+ # hidden visibility so it never leaks into the httpp .so/.a's public
33
+ # symbols.
35
34
  file(GLOB HTTPP_CORE_SOURCES ${PROJECT_SOURCE_DIR}/src/core/*.cpp)
36
35
 
37
36
  # Swagger UI (vendored in src/third_party/swagger-ui) is compiled into the library: at CONFIGURE time its three
@@ -61,7 +60,7 @@ embed_files(
61
60
 
62
61
  # liburlparser (git submodule, built from source - no system package) does
63
62
  # the real URL parsing (scheme/host/port/path, IPv4/IPv6, PSL-aware). It is
64
- # linked PRIVATE into httpp_core, same as cpp-httplib: consumers of
63
+ # linked PRIVATE into httpp_core, same as mbedtls: consumers of
65
64
  # <httpp/url.hpp> see only httpp::url, never urlparser::url directly.
66
65
  set(BUILD_PYTHON OFF CACHE BOOL "" FORCE)
67
66
  # Needed so liburlparser's static lib can be linked into httpp's shared
@@ -69,7 +68,7 @@ set(BUILD_PYTHON OFF CACHE BOOL "" FORCE)
69
68
  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
70
69
  add_subdirectory(${PROJECT_SOURCE_DIR}/src/third_party/liburlparser)
71
70
 
72
- # mbedtls (TLS support for HTTPS, via cpp-httplib's CPPHTTPLIB_MBEDTLS_SUPPORT).
71
+ # mbedtls (TLS support for HTTPS: src/core/tls_session.cpp).
73
72
  set(ENABLE_PROGRAMS OFF CACHE BOOL "" FORCE)
74
73
  set(ENABLE_TESTING OFF CACHE BOOL "" FORCE)
75
74
  set(MBEDTLS_FATAL_WARNINGS OFF CACHE BOOL "" FORCE)
@@ -166,15 +165,12 @@ target_include_directories(httpp_core
166
165
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
167
166
  $<INSTALL_INTERFACE:httpp/sdk/include>
168
167
  )
169
- # SYSTEM: these are vendored/third-party headers we don't control (cpp-httplib,
170
- # indicators, etc.). Marking them SYSTEM tells the compiler their own internal
168
+ # SYSTEM: these are vendored/third-party headers we don't control (indicators, etc.). Marking them SYSTEM tells the compiler their own internal
171
169
  # warnings (e.g. indicators.hpp's narrowing-conversion C4244/C4267 on MSVC)
172
170
  # aren't ours to fix and shouldn't surface under our own -Wall/-Wextra/-W4
173
171
  # below - without patching vendored code to silence its own warnings.
174
172
  target_include_directories(httpp_core PRIVATE ${HTTPP_GENERATED_DIR})
175
173
  target_include_directories(httpp_core SYSTEM PRIVATE
176
- ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/cpp-httplib
177
- ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/aixlog
178
174
  ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party
179
175
  )
180
176
 
@@ -182,16 +178,14 @@ find_package(Threads REQUIRED)
182
178
  target_link_libraries(httpp_core PUBLIC Threads::Threads)
183
179
  target_link_libraries(httpp_core PRIVATE url::base httpp_llhttp)
184
180
 
185
- # HTTPS support: mbedtls is linked PRIVATE and CPPHTTPLIB_MBEDTLS_SUPPORT is
186
- # only ever defined in src/core/internal/httplib_common.hpp (never in a
187
- # public header), so consumers of httpp never need mbedtls on their own
188
- # include/link path - see that file for the shared httplib.h include.
181
+ # HTTPS support: mbedtls is linked PRIVATE and only src/core/tls_session.cpp
182
+ # includes its headers, so consumers of httpp never need mbedtls on their own
183
+ # include/link path.
189
184
  target_link_libraries(httpp_core PRIVATE mbedtls mbedx509)
190
- target_compile_definitions(httpp_core PRIVATE CPPHTTPLIB_MBEDTLS_SUPPORT)
191
185
  # Asio (standalone, header-only, vendored) runs the async engines: the server's
192
186
  # connection loop and the non-blocking client (epoll on Linux, kqueue on macOS,
193
187
  # IOCP on Windows). It is only ever included from src/core/async_server.cpp and
194
- # src/core/async_http.cpp, never together with httplib.h.
188
+ # src/core/async_http.cpp.
195
189
  # Where Asio comes from, in order:
196
190
  # 1. -DHTTPP_ASIO_INCLUDE_DIR=<directory containing asio.hpp> (offline builds, packagers)
197
191
  # 2. src/third_party/asio, if it holds a copy: a git submodule (<dir>/asio/include)
@@ -231,13 +225,18 @@ if(WIN32)
231
225
  target_compile_definitions(httpp_core PRIVATE _WIN32_WINNT=0x0A00)
232
226
  target_link_libraries(httpp_core PRIVATE ws2_32 mswsock crypt32)
233
227
  endif()
228
+ # The operating system log handlers (src/core/logging_os.cpp, ADR-0056): the Event Log lives in advapi32, logcat in liblog.
229
+ if(WIN32)
230
+ target_link_libraries(httpp_core PRIVATE advapi32)
231
+ elseif(ANDROID)
232
+ target_link_libraries(httpp_core PRIVATE log)
233
+ endif()
234
234
  if(MSVC)
235
235
  # Asio's templates produce very large object files.
236
236
  set_source_files_properties(${PROJECT_SOURCE_DIR}/src/core/async_http.cpp ${PROJECT_SOURCE_DIR}/src/core/async_server.cpp PROPERTIES COMPILE_OPTIONS "/bigobj")
237
237
  endif()
238
238
 
239
- # macOS: cpp-httplib (src/third_party/cpp-httplib/httplib.h) reads the
240
- # system trust store via the Keychain APIs (CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN),
239
+ # macOS: src/core/tls_session.cpp reads the system trust store via the Keychain APIs,
241
240
  # which pulls in CoreFoundation/Security symbols (e.g. SecTrustSettingsCopyCertificates).
242
241
  # These aren't linked by default and must be added explicitly, or the final
243
242
  # link of libhttpp_core.dylib fails with "symbol(s) not found for architecture".
@@ -268,6 +267,7 @@ if(HTTPP_BUILD_CLI)
268
267
  )
269
268
  target_link_libraries(httpp_cli PRIVATE httpp_core)
270
269
  target_include_directories(httpp_cli SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/src/third_party/CLI11)
270
+ target_include_directories(httpp_cli PRIVATE ${PROJECT_SOURCE_DIR}/src/core)
271
271
  target_compile_definitions(httpp_cli PRIVATE CLI11_HAS_FILESYSTEM=0)
272
272
  if(WIN32)
273
273
  target_compile_definitions(httpp_cli PRIVATE _WIN32_WINNT=0x0A00 NOMINMAX WIN32_LEAN_AND_MEAN)
@@ -1,5 +1,40 @@
1
1
  # httpp hand-off (consolidated, 2026-11-05; updates 2026-11-06 and 2026-11-07 below)
2
2
 
3
+ > **Update 2026-11-14 (newest, read first): version 0.9.0 (`HTTPP_VERSION_MINOR`/`PATCH` in `include/httpp.h`; CHANGELOG has the section and an empty `[Unreleased]`). Nothing is committed, tagged or pushed (the owner does that). Next free ADR number: 0072. Done: free-threaded `AsyncClient`/`Request.run_async` fix (thread-state pin in `_done_trampoline`) and the client pool limit 8 to 256 (ADR-0071, test `async_pool.a_burst_larger_than_eight_keeps_all_its_connections_for_the_next_burst`); `benchmarks/run.sh` drops the cached `BENCH_*` options on every run; `benchmarks/results/full/*.json` are the owner's `run.sh full` of 2026-11-14 (governor `performance`). Checked: C++ 551/551 on Linux from a build of the merged tree. NOT checked: the full Python suite on this tree, Windows, macOS, the `diag_sync_client.py` sweep after the pool fix.
4
+ >
5
+ > **Update 2026-11-12 (newest, read first): ADR-0062. The C++ request names match Python's: `httpp::request` is the client builder (was `httpp::client::request`, removed), `httpp::server_request` is the handler's request (was `httpp::request`). Done by a scripted rename over include, src, tests, examples, benchmarks and the Cython declarations; ADRs 0051 to 0053 keep the old names on purpose. The docs site (`docs/site`, ADR-0060, workflow `docs.yml`) is not committed either. Checked on Linux from a build of this tree: C++ 522/522, Python 576 passed and 7 skipped, parity test 7/7; NOT checked: Windows, macOS, a pip wheel. Next free ADR number: 0063. Not renamed: C++ has one `httpp::response`, Python has `Response` and `ResponseHead`.
6
+ >
7
+ > **Update 2026-11-11 (very newest, read first): version 0.8.1 (`HTTPP_VERSION_PATCH` in `include/httpp.h`, CHANGELOG has the section). Nothing is pushed; the owner commits and tags. Next free ADR number: 0059.**
8
+ > Done in this stretch: `httpp::path` (ADR-0055, pathlib-shaped, public, `open()`, `cwd()`, `as_uri()`, `as_posix()`; Python takes str/bytes/pathlib.Path), `fs` merged into `path` (ADR-0058), public `httpp/logging.hpp` with `HTTPP_API` and no pimpl (ADR-0057), `set_log_system` with the ported OS handlers (ADR-0056). Leak checks (Linux): C++ ASan/LSan/UBSan clean on 523 tests, Python RSS plateaus on 3.13 and 3.14t. Full Python suite: 853 passed, 5 skipped on 3.14t.
9
+ > **macOS wheel (PR #183, cp313t x86_64 under Rosetta) died at `test_ctrl_c_at_any_moment_never_wedges_listen`: a test race, not a core bug.** The old test used `threading.Timer(rnd.uniform(0, 0.12), _thread.interrupt_main)` and called `sender.start()` outside the `try`; with a delay near 0 the interrupt landed inside `Thread.start()` (which waits on an Event), escaped into pytest, exit code 2 after 230 passed. Proven with a stand-alone script (3000 of 3000 starts received the interrupt on 3.13; on 3.14t the Event lock was even corrupted: "release unlocked lock"). Fix, in the test only: a plain Thread waits on a list flag, the flag is set on the first line inside the `try`, and `finally` tolerates a late interrupt (no join). Passes 6 times on 3.13 and 6 on 3.14t. **NOT verified on macOS:** that `Server.listen()` itself survives the interrupt there; the test never reached that part before. If the next macOS CI run hangs or fails inside `listen()`, that is a real core bug: investigate then (listen polls a plain flag every 50 ms, see the ponytail note in `server.py`).
10
+ > **Open risks the owner accepted (CI decides):** the Windows halves of `path.cpp`, class-level `HTTPP_API` export of `logging::handler`/`file_handler` on MSVC, `logging_os` for Android, Apple and Windows (compiled nowhere yet). Question to the owner, unanswered: 0.8.1 or 0.9.0 for this much API (public path and logging).
11
+ > **Rules (also in memory):** talk Persian; code, comments, docs English, no em dash, no Persian in code; never push; after each step zip as httpp.zip (exclude .git/, build*/, __pycache__, *.whl) and send it; never `std::filesystem`; no system dependencies; a decision gets an ADR; do not sweep problems under the carpet (no timeout bumps or skips as a fix).
12
+ >
13
+ > **Update 2026-11-11 (newest): `httpp::fs` was merged into `httpp::path` (ADR-0058): no `fs.hpp`/`fs.cpp`, the CLI and the tests link `httpp_core`. Next free ADR number: 0059.
14
+ >
15
+ > **Update 2026-11-11 (latest): the logging module is public (`include/httpp/logging.hpp`, ADR-0057, amends 0050); `logging.cpp` is no longer compiled into the test program. Next free ADR number: 0058.
16
+ >
17
+ > **Update 2026-11-11 (later): `set_log_system` (ADR-0056) sends the log to the OS log (ported from libstb: `src/core/logging_os.cpp`); only syslog was run (Linux), the Android, Apple and Windows handlers were not compiled. Next free ADR number: 0057.
18
+ >
19
+ > **Update 2026-11-11: `httpp::path` (ADR-0055, public header `httpp/path.hpp`) is the pathlib-shaped path type of the public API; Python takes `pathlib.Path` everywhere (`_fs()` in `cy/client.pxi`). Next free ADR number: 0056 (see the newer update).
20
+ >
21
+ > **Update 2026-11-10 (later): the owner said "no filesystem, write our own": `httpp::fs` (`src/core/internal/fs.{hpp,cpp}`, ADR-0054) replaces std::filesystem and five private copies of file operations (download, file_browser, server, CLI, logging); `fs.cpp` is also compiled into the CLI and the test program. The Windows half was written without Windows and the macOS build was not run: both are for CI. Next free ADR number: 0056 (see the newer update).
22
+ >
23
+ > **Update 2026-11-10 (earlier): macOS CI fix.** The previous CI run failed on macOS (`std::filesystem::path` in `internal/logging.hpp`, unavailable below 10.15): `file_handler` takes a UTF-8 string now. Guard test `tests/python/test_portability_sources.py`. Python log bridge: `Py_IsInitialized()` check in the trampoline and an atexit unhook (from libstb's bridge fix). libstb diff since the port: core logging files unchanged since 2026-11-05; NOT ported (waiting for the owner): the OS handlers (`logging_os`: syslog, logcat, os_log, OutputDebugString, Event Log). Linux: C++ 480/480, Python 851 passed, 1 skipped. macOS/Windows not run here.
24
+ >
25
+ > **Update 2026-11-09 (night, not committed): cpp-httplib is RETIRED (ADR-0051, 0052, 0053).** Blocking client on the async engine through `src/core/internal/http_exchange.{hpp,cpp}`; downloads stream through `body_sink` on `download_async_http()` (`download.cpp`: one `file_target` + one `transfer()`); `curl.cpp` wraps `client::request`; `src/third_party/cpp-httplib` and `httplib_common.hpp` are deleted. New tests: `test_client_blocking_engine.cpp` (8), `test_async_stream.cpp` (6), `test_download_transfer.cpp` (8). Last runs (Linux, Python 3.13, wheel built from the final tree): C++ 479/479, Python 850 passed, 1 skipped (free-threaded only). NOT verified: Windows, macOS (the Keychain link flags are kept), Python 3.14t, comparison with live sites. Known ponytail: file writes block the download loop thread (upgrade: a small bounded write pool). Next free ADR number: 0055 (see the newer update).
26
+
27
+ > **Update 2026-11-09 (not committed).** Done since the evening block, tests first, ADR each: (5) MIME table unified and the 18 KB `async_http` exchange leak fixed (ADR-0047); (6) `router::route_ws` / `APIRouter.websocket` and `Depends` on WebSocket routes (ADR-0048; 2 C++ tests, 15 Python tests). The checklist item "total deadline for a dripped body" was stale: `set_body_timeout` exists. Last runs: C++ 457/457, Python 847+ passed, 4 skipped, parity test green. The Cython module was split into `cy/*.pxi` files (pure move, no behaviour change; ADR-0049). Logging: AixLog removed, replaced by the internal module ported from libstb (ADR-0050; C++ 457/457). Next free ADR number: 0051. Deliberately NOT done, next candidates: TLS certificate reload without restart, bounded recursive search in the file browser, Windows Job Object, ASan on the Python extension. Not verified: Windows, macOS, Python 3.14t.
28
+
29
+ > **Update 2026-11-08, evening (not committed).** The owner released the version and CI is green on the real runners, so the "CI fixes NOT yet confirmed" note below is out of date. Done in this step, all with tests first and an ADR each: (1) WebSocket close 1001 when the server drains (ADR-0043; `tunnel::on_drain`, 2 session tests, 3 server tests, 2 Python tests); (2) `--workers` respawn with back-off, crash-loop give-up and PR_SET_PDEATHSIG (ADR-0044; `_WorkerGroup` in `_run.py`; the old "a dead worker stops the group" test became a crash-loop test); (3) ETag, Last-Modified, 304, 412, If-Range for mounted files (ADR-0045; 9 C++ tests, 1 Python test; the engine no longer writes `Content-Length` on a 304); (4) `TestClient.files=` and `websocket_connect` (ADR-0046; 11 tests). Next free ADR number: 0047. Not verified: Windows, macOS, Python 3.14t for this step. Still open from the list below: (a) Windows Job Object, (b) one asyncio loop under the GIL, (c) the unnamed macOS failure, (e) Python 3.15t, in-memory TestClient.
30
+
31
+
32
+ > **START HERE (2026-11-08, for the next chat).** Working tree is uncommitted and nothing was ever pushed (owner rule: never push; after each step zip the project as httpp.zip and send it). Details of every item are in the update notes (1)-(11) right below.
33
+ > **State.** CLI is native (`httpp/sdk/bin/httpp`, CLI11) plus the Python launcher `httpp_cli.py`; `python -m httpp ARGS` is the same program as `httpp ARGS`; the Python half is `httpp py run|path` (old spellings exit 2 with a hint). Wheel layout is `httpp/sdk/{bin,include,lib}`. `httpp.testclient.TestClient` exists (ADR-0042). Next free ADR is 0043. Linux sandbox: full Python suite green on 3.13 and 3.14t.
34
+ > **CI fixes written from logs but NOT yet confirmed green on the real runners:** macOS delocate (`@loader_path` for the CLI RPATH), Windows (DLL in `sdk/bin`, `normcase`, `stop_process` with taskkill, NO_COLOR fixture), musllinux (no-Python test runs the exe in place), macOS `test_io_threads` (kernel-dependent spread; now asserts only the lane-name bound everywhere and the spread on Linux). Last CI seen: Release PR #169 (macOS), only the race of note (12) failed. Next step is to read the next CI log.
35
+ > **Owner rules for work in this repo.** Reply in Persian, concisely; code, commands and comments in English only; give honest technical opinions and say plainly when a fix is a workaround; no environment hacks inside tests when the project config (CMake/CI) is the right place; `test_version` was deleted on purpose (do not bring it back).
36
+ > **Open, not started.** (a) Windows launcher: a Job Object so that killing the launcher kills the native server (then the taskkill workaround in `conftest.py` can go); known limitation today: externally terminating the Python launcher on Windows leaves the native server running. (b) Why with the GIL only one asyncio loop remains although `io_threads=4`: read `server.py` around lines 1020-1040 (a comment there says free-threaded builds give every I/O thread its own loop). (c) The first macOS log had a `1 failed` whose test name was never seen. (d) TestClient extras: `websocket_connect`, multipart `files=`, in-memory mode without a socket. (e) Python 3.15t was not run locally.
37
+
3
38
  > **Update 2026-11-07, later (not committed).** CI on macOS failed 71 CLI tests: the CMake test target runs the suite on a staged install directory where pip never made the `httpp` console script. Fixes, all in the working tree:
4
39
  > (1) `tests/python/conftest.py`: `httpp_exe` looks up the console script only for its `command` variant, which is skipped when there is none; the `binary` variant (`httpp/bin/httpp`) always runs.
5
40
  > (2) Owner decision: **`python -m httpp ARGS` is the same program as `httpp ARGS`** (`__main__.main` calls `httpp_cli.main`; the Python half is `__main__.py_main`). So `python -m httpp py run main:app`, `python -m httpp server ...`; the old `python -m httpp run` fails with exit 2 like `httpp run`.
@@ -14,6 +49,7 @@
14
49
  > (9) CI of PR #165, wheel job on Linux (musllinux container, 1 failed of 533): `test_without_a_python_the_error_says_what_to_do` copied the executable to a temp folder and set `LD_LIBRARY_PATH` to `sdk/lib`; after `auditwheel repair` the executable needs libstdc++ and libgcc from `httpp.libs` through its RPATH, which the copy lost (exit 127, "Error loading shared library libstdc++-..."). The test now runs the executable in place (no Python lives next to `sdk/bin` anyway) with an empty PATH and no HTTPP_PYTHON, so it no longer copies anything or imitates the library search path. Linux here: 803 passed, 4 skipped (`test_version`, 2 cases, is gone).
15
50
  > (10) CI of PR #166, wheel job on Windows (cp314t-win32, 2 failed of 531, cp39 jobs all green): `test_py_help_is_the_python_help[command|binary]` got ANSI colour codes in the help text, because Python 3.14 argparse colours when `FORCE_COLOR` is set (CI sets it) and the 3.9 jobs have no colour. An autouse fixture in `conftest.py` (monkeypatch, so scoped to each test) removes `FORCE_COLOR` and sets `NO_COLOR=1`, `PYTHON_COLORS=0`. Also at the owner's request: `PYTHONPATH` no longer set in `conftest.py`; `tests/python/CMakeLists.txt` sets it (ctest `ENVIRONMENT` and `cmake -E env` for the custom target). Checked on a staged copy with PYTHONPATH given from outside.
16
51
  (11) CI of PR #167, wheel job on macOS (1 failed of 531): `test_loops_follow_the_io_threads_only_without_a_gil` expected exactly one loop name on a free-threaded macOS build ("macOS does not spread connections"), but the kernel did spread them (`httpp-asyncio` and `httpp-asyncio-1`). That is kernel behaviour, not ours: free-threaded builds now assert the spread only on Linux and nothing about the count elsewhere; GIL builds still expect exactly one loop. Not reproducible on Linux; the cause is read from the log.
52
+ (12) CI of Release PR #169, wheel job on macOS (cp314t x86_64 under Rosetta, 1 failed of 531): `test_cli_run_wins_over_a_listen_call_at_import_time[1]` got return code -2 (killed by SIGINT) after SIGTERM. Real race in `Server.listen`: the serving thread was started before the `try`, so a SIGTERM/Ctrl+C landing in that gap raised KeyboardInterrupt out of `listen` (an uncaught KeyboardInterrupt ends the process with SIGINT). Now `thread.start()` is inside the `try`, and an interrupt before the thread existed stops nothing. Not reproducible by timing on Linux (12 runs green); reproduced deterministically by sending SIGINT from a patched `Thread.start` and covered by `test_an_interrupt_right_after_the_server_thread_started_is_a_graceful_stop` (failed before the fix, passes now). The macOS cause is inferred from that, not seen directly. Remaining tiny window: a second signal arriving exactly at the `while not finished` check inside the graceful loop.
17
53
  Still open: one `1 failed` line of the macOS CI log was cut off (test name unknown, did not reproduce on Linux); nothing else known.
18
54
 
19
55
  > **Update 2026-11-07 (not committed, all in the working tree).** The command line moved to C++ (ADR-0041, **the next free ADR is 0042**), written first and only then built and tested at the owner's request.
@@ -51,7 +87,7 @@ This is a long collaboration, not a one-off task. Mohammad is an experienced sys
51
87
  A C++ HTTP library (async server on Asio + llhttp, clients, downloads, progress bars, URL, WebSocket, read-only file browser) with a Cython/Python layer. Direction (ADR-0001): httpp replaces FastAPI/Starlette above and uvicorn below: a Starlette/FastAPI-like API implemented natively on our own engine, launched by `httpp run main:app` or `app.run()`. Handlers run on a standard asyncio loop (ADR-0002); no ASGI adapter is needed (low priority). One design for the C++ and the Python API; only GIL related differences.
52
88
 
53
89
  ## 2. Standing rules
54
- - `cpp-httplib` (`src/third_party/cpp-httplib/httplib.h`, v0.54.1) stays byte-identical to upstream; llhttp is unmodified and stays vendored (owner decision, 2026-11-05: no SIMD patch, no own parser, no copy of Drogon's parser; do not bring it up unless a profile shows the parser is the hot path and he asks). Document any vendor change in `src/third_party/README.md`. Asio, mbedtls, liburlparser are submodules.
90
+ - cpp-httplib is gone (ADR-0053); llhttp is unmodified and stays vendored (owner decision, 2026-11-05: no SIMD patch, no own parser, no copy of Drogon's parser; do not bring it up unless a profile shows the parser is the hot path and he asks). Document any vendor change in `src/third_party/README.md`. Asio, mbedtls, liburlparser are submodules.
55
91
  - Zero system dependencies (nothing from apt/brew; vendor or submodule; pip build deps are fine).
56
92
  - macOS wheels target 10.13: avoid `std::filesystem`, floating `to_chars`, `std::optional` accessors and other post-10.13 libc++ APIs in `src/core`.
57
93
  - Be honest about "async" and the GIL: say what is truly non-blocking and what is a thread pool.
@@ -62,9 +98,9 @@ A C++ HTTP library (async server on Asio + llhttp, clients, downloads, progress
62
98
  include/httpp/ public API (client, server, websocket, download, url, progress, router, file_browser, swagger_ui ...)
63
99
  src/core/ async_server.cpp (Asio engine + llhttp; tunnel for upgrades), server.cpp (router, hooks, static files, run_ws),
64
100
  websocket.cpp + internal/websocket.hpp, websocket_api.cpp, async_http.cpp (async client), client.cpp / download.cpp /
65
- curl.cpp (httplib, sync), file_browser.cpp, inflate/deflate/content_decode (vendored stb codecs), log.cpp, tls_session.cpp
101
+ curl.cpp (thin face on client::request), file_browser.cpp, inflate/deflate/content_decode (vendored stb codecs), log.cpp, tls_session.cpp
66
102
  src/assets/ file_browser.html (embedded with COMPRESS)
67
- src/bindings/python/ httpp_cy.pyx (Cython glue), httpp/server.py, _params.py, _websocket.py, _run.py, _validate*.py, _router.py, __main__.py ...
103
+ src/bindings/python/ httpp_cy.pyx (Cython glue: cimports plus textual includes of cy/*.pxi, one module, one .so), httpp/server.py, _params.py, _websocket.py, _run.py, _validate*.py, _router.py, __main__.py ...
68
104
  tests/cpp tests/python benchmarks/ tools/autobahn/ docs/adr/ docs/Architecture.md checklist.md
69
105
  ```
70
106
  Request paths:
@@ -72,8 +108,8 @@ Request paths:
72
108
  - **`async def` route**: I/O thread -> `route_io` -> per-lane inbox (mutex + deque, wake byte; no GIL on the I/O thread) -> asyncio loop thread of that lane drains a burst with the GIL held once -> task -> `done()`. A handler that cannot suspend may run inline on the I/O thread when its loop sleeps (ADR-0023); default on only with 2 CPUs or fewer.
73
109
  - **Lanes (ADR-0024)**: `set_io_threads(n)` = one engine per I/O thread on one port (SO_REUSEPORT). Python: one asyncio loop per I/O thread only on a free-threaded build, else one loop. Default `io_threads` = `min(4, CPUs // 4)` with a GIL, 1 without a GIL or on Windows. With several I/O threads a new connection goes to the engine with the fewest connections (ADR-0034).
74
110
  - `after_request`/`error_handler` hooks make `done` go through `run_in_executor`. The hook path of `make_sender` no longer touches `this` after `weak.lock()` (ADR-0035).
75
- - **WebSocket (ADR-0026, 0027)**: generic engine tunnel; `ws_session` implements RFC 6455 (frames, fragments, control frames, close handshake, UTF-8 and close-code checks, bounded send queue, ping). Python `@app.websocket(path, ...)` with a Starlette-shaped `websocket` object, per-connection C++ mailbox. Same-origin default policy. Not supported on WebSocket routes: dependencies, `response`, background tasks, OpenAPI, `APIRouter.websocket`. No permessage-deflate, no TLS of its own.
76
- - **File browser (ADR-0032)**: `httpp::mount_file_browser(server&, base, root, file_browser_options)`; Python `Server.mount_file_browser(base, root, **options)`; CLI `httpp browse [DIRECTORY]`. Read-only; the root is a ceiling (`..`, absolute paths, backslash, NUL, symlinks out are refused with the same 404); dotfiles hidden unless `show_hidden`; active types always downloads; no login (use the `before` hook); `search` filters the open folder; no ETag in v1.
111
+ - **WebSocket (ADR-0026, 0027)**: generic engine tunnel; `ws_session` implements RFC 6455 (frames, fragments, control frames, close handshake, UTF-8 and close-code checks, bounded send queue, ping). Python `@app.websocket(path, ...)` with a Starlette-shaped `websocket` object, per-connection C++ mailbox. Same-origin default policy. Routers and `Depends` work on WebSocket routes (ADR-0048). Not supported: `response`, background tasks, OpenAPI. No permessage-deflate, no TLS of its own.
112
+ - **File browser (ADR-0032)**: `httpp::mount_file_browser(server&, base, root, file_browser_options)`; Python `Server.mount_file_browser(base, root, **options)`; CLI `httpp browse [DIRECTORY]`. Read-only; the root is a ceiling (`..`, absolute paths, backslash, NUL, symlinks out are refused with the same 404); dotfiles hidden unless `show_hidden`; active types are downloads, except html and svg, which Open raw renders under a CSP sandbox (`set_safe_mode(true)` / `--safe` makes them downloads too, ADR-0070); no login (use the `before` hook); `search` filters the open folder; no ETag in v1.
77
113
  - **Server compression**: `set_compression(min_size, level)` / `Server(compression=...)`: text answers only, off by default; no ADR yet and no benchmark.
78
114
 
79
115
  ## 4. Build and test
@@ -88,7 +124,7 @@ Request paths:
88
124
  - `perf` on his machine: his `perf report --symbol-filter=...` did NOT filter (all outputs were identical); use `--sort dso,symbol` plus `grep`, or `-S` with the mangled name.
89
125
 
90
126
  ## 5. State after the last session (2026-11-05)
91
- Nothing is committed or pushed (the owner commits). Version in the tree is 0.8.0; `CHANGELOG.md` has the pending items under `[Unreleased]` (next version 0.8.1).
127
+ Nothing is committed or pushed (the owner commits). Version in the tree is 0.9.0 (bumped 2026-11-14; the owner commits and tags it); `CHANGELOG.md` has the 0.9.0 section, `[Unreleased]` is empty.
92
128
 
93
129
  ### Verified
94
130
  - C++ suite 407 tests pass in Release, and are clean under AddressSanitizer (no memory errors) and ThreadSanitizer (no warnings).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: httpp
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: A Cython project with scikit-build
5
5
  Author-Email: Mohammad Raziei <mohammadraziei1375@gmail.com>
6
6
  License: MIT
@@ -138,6 +138,7 @@ Static files can be served next to your routes:
138
138
 
139
139
  ```python
140
140
  app.serve_directory("/static", "./public")
141
+ httpp.Directory("./public", index=False, show_hidden=False).mount(app, "/assets") # with settings
141
142
  ```
142
143
 
143
144
  ### Handler reference
@@ -224,6 +225,7 @@ app.include(api, "/v1") # GET /v1/api/users/{user_id} (include_router is
224
225
  The order is: outer prefix, the router's own prefix, then the route's path. A route path `/` under a prefix is the
225
226
  prefix itself (`/users`, never `/users/`). Prefixes are joined once, when `include()` runs, so a request costs the same as
226
227
  with plain `@app.get(...)`. A router is not kept by the server: routes added to it afterwards are not on the server.
228
+ WebSocket routes work the same way (`@users.websocket("/ws/{room}")`, C++: `router::route_ws`), and a WebSocket handler may use `Depends` (for example to check a token before the upgrade).
227
229
 
228
230
  ### The `response` argument and background work
229
231
 
@@ -318,7 +320,20 @@ def login():
318
320
  ### A read-only file browser
319
321
 
320
322
  ```python
321
- app.mount_file_browser("/files", "/srv/shared", title="Shared", theme="dark", accent="#2a7de1", show_hidden=False)
323
+ from httpp import FileBrowser
324
+
325
+ FileBrowser("/srv/shared", title="Shared", theme=FileBrowser.Theme.DARK, accent="#2a7de1").mount(app, "/files")
326
+ # or chained: FileBrowser("/srv/shared").set_title("Shared").set_show_hidden(False).mount(app, "/files")
327
+ ```
328
+
329
+ The same in C++ (a builder with enums; a bad accent or `max_entries` throws at the setter):
330
+
331
+ ```cpp
332
+ httpp::file_browser("/srv/shared")
333
+ .set_title("Shared")
334
+ .set_theme(httpp::file_browser::theme_mode::dark)
335
+ .set_accent("#2a7de1")
336
+ .mount(server, "/files");
322
337
  ```
323
338
 
324
339
  ```
@@ -327,7 +342,7 @@ httpp browse ~/Downloads --port 8000 --theme auto
327
342
 
328
343
  Lists folders, opens text and images, downloads files; nothing can be written, renamed or deleted. The folder you give is a ceiling:
329
344
  `..`, absolute paths and symlinks that leave it are refused, dotfiles are hidden (404 too) unless `show_hidden=True` / `--hidden`, and html, svg and
330
- other active types are always downloads. A folder is cut at `max_entries` (5000). It has **no login**: it listens on 127.0.0.1 by default, and for anything
345
+ other active types are downloads, but html and svg are rendered by "Open raw", sandboxed so no script runs (`safe_mode=True` / `--safe` makes them downloads too). A folder is cut at `max_entries` (5000). It has **no login**: it listens on 127.0.0.1 by default, and for anything
331
346
  else put a `before_request` hook in front of it. A bad option or folder raises `ValueError`.
332
347
 
333
348
  ### Settings
@@ -456,9 +471,10 @@ httpp py run main:app --reload # development: restart when a .py
456
471
  each have their own GIL and share one port (`SO_REUSEPORT`; the kernel spreads connections). Each
457
472
  worker is a fresh process that imports the app itself, which is why `workers > 1` needs an import
458
473
  string (`"main:app"`), like uvicorn and gunicorn; module-level state is therefore per worker.
459
- Linux only for now. If a worker dies, the supervisor stops the others and exits with code 1 (let
460
- systemd or Docker restart it); it does not respawn workers yet. Keep the supervisor alive: killing it
461
- with SIGKILL leaves its workers running.
474
+ Linux only for now. If a worker dies, the supervisor starts a new one (at once the first time, then
475
+ after 0.5, 1, 2 and 4 seconds while it keeps dying right after it starts); a worker that keeps dying
476
+ that way stops the whole group with exit code 1, so a broken app or a busy port is not hidden. If the
477
+ supervisor itself is killed, even with SIGKILL, the kernel sends SIGTERM to its workers.
462
478
  - `workers="auto"` / `--workers auto` starts one worker per CPU the process can use: its affinity mask,
463
479
  capped by a container CPU quota (rounded down, at least 1). It runs a single process on one CPU, off
464
480
  Linux, and when `app` is an object rather than an import string (it says so).
@@ -535,7 +551,7 @@ def test_items():
535
551
  It follows Starlette's interface: `get`, `post`, `put`, `patch`, `delete`, `head`, `options`, `request`; `params`, `headers`, `json`, `data` (a dict is a form), `content`, `cookies`, `auth=("user", "pw")`,
536
552
  `follow_redirects` (on by default), `base_url` (default `http://testserver`, the `Host` the app sees). Cookies the server sets are kept and sent back (`client.cookies`).
537
553
  A handler that raises with no exception handler for it is raised again in your test (`raise_server_exceptions=False` gives you the 500 instead). Without `with`, the first request starts the server and `client.close()` stops it.
538
- Not yet: `websocket_connect`, multipart `files=`, and a mode without a socket (ADR-0042).
554
+ `files=` sends multipart, and `client.websocket_connect("/ws")` gives a session with `send_text`, `receive_text`, `send_json` and friends (ADR-0046). Not there: a mode without a socket (ADR-0042).
539
555
 
540
556
  ### TLS (https, wss)
541
557
 
@@ -564,13 +580,13 @@ app.add_middleware(GZipMiddleware, minimum_size=1000)
564
580
  ```
565
581
 
566
582
  The options are Starlette's. The work runs in C++ without the GIL: a CORS preflight is answered on the I/O thread and never reaches Python.
567
- `before_request` hooks run after the middleware, `after_request` hooks before it. In C++: `httpp::add_cors(server&, cors_options)`,
568
- `httpp::add_trusted_host(server&, trusted_host_options)` (`httpp/middleware.hpp`), or your own pair of hooks with `server::use(before, after)`.
583
+ `before_request` hooks run after the middleware, `after_request` hooks before it. In C++: `httpp::cors().set_allow_origins({...}).install(server&)`,
584
+ `httpp::trusted_host({...}).install(server&)` (`httpp/middleware.hpp`), or your own pair of hooks with `server::use(before, after)`.
569
585
  Not supported: ASGI middleware. `HTTPSRedirectMiddleware` sends plain requests to the https address (see TLS below).
570
586
 
571
587
  ## Build from source
572
588
 
573
- Most dependencies are vendored (`cpp-httplib`, unmodified; `llhttp`, unmodified) or git submodules
589
+ Most dependencies are vendored (`llhttp`, unmodified) or git submodules
574
590
  (`mbedtls`, `liburlparser`, `asio`). The full history of the `mbedtls` submodule is large; if you only need the source, clone
575
591
  with `git clone --depth 1 --recurse-submodules --shallow-submodules`.
576
592
 
@@ -594,22 +610,22 @@ httpp is **alpha**: the API can still change between minor versions. Current lim
594
610
  be cancelled by `handler_timeout`. Handler code is Python, so it still needs the GIL: `async def`
595
611
  handlers share one loop thread, plain `def` handlers take the GIL on pool threads (set `threads=` to
596
612
  fit your blocking calls), and real parallelism needs `--workers` or a free-threaded Python (below).
597
- - HTTP/1.1 only; the server does not speak TLS; a cancelled `await` stops waiting but the request itself
613
+ - HTTP/1.1 only (the server speaks TLS, see the TLS section); a cancelled `await` stops waiting but the request itself
598
614
  keeps running until it finishes.
599
615
  - Platforms: the connection layer is tested on Linux. Windows and macOS are untested by the author; CI
600
616
  on those platforms is the real check.
601
617
  - There is no ASGI or WSGI interface (see above), so ASGI/WSGI applications such as FastAPI or Flask
602
618
  cannot be mounted on it yet.
603
- - `cpp-httplib` (unmodified) now serves only the synchronous client; the server and the async engine are
604
- our own (Asio + llhttp). It is planned to retire it once the synchronous client is ours too.
619
+ - cpp-httplib is no longer used: the server, the client (blocking and async) and downloads all run on our own
620
+ engines (Asio + llhttp + mbedTLS), see ADR-0051 to ADR-0053.
605
621
  - The libcurl compatibility layer covers a subset of `curl_easy_*`.
606
- - No auto-reload. `--workers` is Linux only and does not respawn dead workers.
622
+ - `--workers` is Linux only.
607
623
 
608
624
  Issues and pull requests are welcome.
609
625
 
610
626
  ## Logging
611
627
 
612
- The library logs through AixLog, privately (it never touches `std::clog` or your own logging). By default
628
+ The library logs through a private logger of its own (it never touches `std::clog` or your own logging). By default
613
629
  warnings and errors go to stderr, e.g. a handler that throws with no exception handler installed.
614
630
 
615
631
  ```cpp