Commit graph

39 commits

Author SHA1 Message Date
wjqserver
e4d3eed379 feat: redesign server startup around Run options
Replace the old RunShutdown and RunTLS style entry points with a single Run(opts...) API for v1. Add focused startup semantics tests, keep TLS and graceful shutdown independent, ensure sibling servers are cleaned up on startup failure, and update docs to match the new option-based startup model.
2026-04-07 17:44:55 +08:00
wjqserver
987ea81329 fix: avoid fixed-path miss panic and trim 405 fallback work 2026-04-07 09:57:16 +08:00
wjqserver
fa027347d3 fix: reduce default error response overhead
Encode the built-in 404 and 405 payload with a fixed struct instead of a map so default error pages allocate less on the hot miss path. Add a regression test to keep the JSON shape stable.
2026-04-07 09:35:39 +08:00
wjqserver
57847fa446 fix: avoid unsafe header buffer reuse
Use safe string copies for pooled header buffers and simplify case-insensitive lookup buffering now that the pseudo stack path was ineffective. This addresses review concerns without changing the routing semantics.
2026-04-07 09:32:14 +08:00
wjqserver
2d4aefc86e fix: cut redirect and allow-path routing overhead
Reuse fixed-path and Allow-header buffers so redirect and OPTIONS handling stop rebuilding temporary data on every request. Cache fallback chains and add regression coverage for redirect, 404, 405, and Allow behavior to keep the faster miss paths stable.
2026-04-07 09:06:56 +08:00
wjqserver
5d979e5670 fix: reduce per-request context and fallback overhead
Make Context keys lazy so requests that never call Set stop allocating on reset. Reuse stable 404 and 405 handlers and add focused benchmarks so ServeHTTP miss paths stay measurable.
2026-04-07 08:39:10 +08:00
wjqserver
6acac9edce fix: streamline route matcher backtracking
Avoid rebuilding skipped-node state during wildcard fallback so the matcher no longer loops on the same static branch and stops allocating on the hot path. Add focused route benchmarks and regression coverage to keep the optimized path stable.
2026-04-07 08:27:00 +08:00
wjqserver
2165cc4114 feat(http2): support OPTIONS * and extended CONNECT 2026-04-02 03:53:17 +08:00
wjqserver
ed44c592d3 fix(reverseproxy): align forwarding and tunnel semantics 2026-04-02 03:18:49 +08:00
WJQSERVER
a98fb27058 fix: correctly propagate custom Protocols to http.Server
- Implemented \`applyDefaultServerConfig\` in \`Engine\` to apply \`serverProtocols\` to \`http.Server\`.
- Uncommented all calls to \`applyDefaultServerConfig\` in \`serve.go\`.
- Refactored \`SetProtocols\` and added internal \`setProtocols\` to ensure user-defined protocols are not overwritten by framework defaults in \`RunTLS\`.
- Added exhaustive tests in \`protocols_test.go\` to verify protocol inheritance and persistence.
2026-03-27 17:27:22 +00:00
WJQSERVER
c4c0160b5f refactor: improve binding, performance, and type safety
- Implement ShouldBind with support for JSON, Form, WANF, and GOB formats
- Add ShouldBindForm, ShouldBindGOB, and helper functions for form binding
- Use fmt.Appendf instead of fmt.Sprintf for better performance
- Replace interface{} with any for modern Go style
- Use maps.Copy for cleaner header copying
- Update strings.SplitSeq to use range over strings.Seq
- Remove deprecated placeholder comments and add proper implementations
- Fix reflect.Pointer usage for Go 1.22+ compatibility
2026-03-17 12:02:49 +08:00
WJQSERVER
2e55db4e2d docs: add comprehensive documentation and fix SSE graceful shutdown
- Created a detailed \`docs\` directory with Chinese documentation for all major features.
- Implemented \`BaseContext\` propagation in \`Engine\` to allow long-lived connections (like SSE) to receive shutdown signals.
- Added \`Engine.Context()\` to provide access to the shutdown context.
- Updated \`docs/sse.md\` with a guide on handling graceful shutdowns.
- Cleaned up temporary build/update scripts.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-02-18 15:52:42 +00:00
WJQSERVER
b348d7d41f update TempSkippedNodesPool 2025-12-14 23:42:50 +08:00
WJQSERVER
60b2936eff add TempSkippedNodesPool 2025-12-14 23:16:29 +08:00
WJQSERVER
904aea5df8 refactor: Improve engine's tree processing and context handling. 2025-12-14 22:56:37 +08:00
wjqserver
c9b8e966c4 remove too much log print 2025-07-27 16:34:46 +08:00
google-labs-jules[bot]
504089b748 feat: add MPL 2.0 license headers to all go files 2025-07-24 08:07:38 +00:00
wjqserver
336b8ad958 fix: missed engine.UnMatchFSRoutes set value 2025-07-09 03:17:16 +08:00
wjqserver
989eb34c4c refactor(internal break) Enhance static file serving for modularity and performance 2025-07-09 03:10:46 +08:00
wjqserver
cb86cb935a add maxBytesReader & ctxMerge 2025-07-08 13:26:18 +08:00
wjqserver
17bab2dcfd remove unuse code 2025-07-06 18:09:37 +08:00
wjqserver
76d07364ae optimize defaulterrorhandle && add SetRespBodyFile 2025-06-25 17:49:03 +08:00
wjqserver
6c6a5a99b1 add slash settings && StaticFS 2025-06-22 18:06:19 +08:00
wjqserver
53544644af use new resolveRoutePath replace path.Join && add UseIf 2025-06-17 14:20:14 +08:00
wjqserver
ebb634b643 update default error handle 2025-06-13 17:53:48 +08:00
wjqserver
0076c7538c fix default error handle 2025-06-13 14:41:10 +08:00
wjqserver
803a6747f6 update serve && add custom srv configure 2025-06-12 09:40:46 +08:00
wjqserver
9a2aeef0d0 remove ANY form MethodsSet to avoid conflict 2025-06-11 11:23:15 +08:00
wjqserver
bb822599b9 update methods 2025-06-11 11:11:54 +08:00
wjqserver
ce5efae287 update 2025-06-10 21:37:53 +08:00
wjqserver
450d6294ad remove dup engine.pool.Put(c) 2025-06-06 22:13:17 +08:00
wjqserver
81fd3902cb fix ctx lifetime 2025-06-06 21:43:16 +08:00
wjqserver
69469c0306 fix NoRoutes 2025-06-05 20:47:41 +08:00
wjqserver
c6c65c04a7 [engine] add NoRoutes 2025-06-05 20:31:18 +08:00
wjqserver
31d2065f07 [engine] add StaticFile 2025-06-04 21:50:03 +08:00
wjqserver
899d3ff48b add logreco 2025-06-04 20:44:23 +08:00
wjqserver
52b900db92 fix fileserver status chain 2025-05-30 21:31:54 +08:00
wjqserver
54ff216eff add static 2025-05-29 21:27:35 +08:00
wjqserver
484f2f016b init(v0.0.1) 2025-05-28 18:25:28 +08:00