feat: compat.websocket server + zlib features (gated; server implies zlib) - #159
Merged
Sunrisepeak merged 1 commit intoAug 5, 2026
Merged
Conversation
FarnaHerry
force-pushed
the
feat/compat-websocket-features
branch
from
August 5, 2026 17:56
293ef5f to
2095650
Compare
Sunrisepeak
added a commit
that referenced
this pull request
Aug 5, 2026
main 上合入了 #159(compat.websocket)与 #160(修 xpkg.lua 里那个把 0.0.47/0.0.48 一起吞掉的畸形 0.0.49 条目),分支落后并冲突。 **冲突让 CI 一个 run 都不建** —— GitHub 在 PR 有冲突时算不出 merge ref,于是 `pull_request` 触发的 workflow 完全不启动。表现是 "no checks reported",极易被 误读成 CI 挂了或 push 没生效。 冲突只在两个 README 的同一张表:main 新增了 websocket 那一行,而我改的是同表的 protobuf 那一行。两边都保留。 合并后核验:74 个描述符全部解析通过;members 同时含 protobuf-protoc 与 websocket / websocket-features。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two optional, gated features to
compat.websocket(#158), keeping the zero-dependency client build as the default:server— compiles the four server TUs the base build leaves out (IXWebSocketServer/IXSocketServer/IXHttpServer/IXWebSocketProxyServer). Verified against the four.cppfiles: only stdlib + already-compiled IX headers, so zero new external deps. Consumers getix::WebSocketServer(derives fromSocketServer, sogetPort()etc. work).zlib—defines = { "IXWEBSOCKET_USE_ZLIB=1" }+deps = { ["compat.zlib"] = "1.3.2" }, turning the gzip codec from its no-op into real permessage-deflate compression. The define reaches the package's own TUs; consumers need no define.serverimplieszlib— a correctness trap found by reading upstream:IXWebSocketServerenables permessage-deflate by default, and the transport's extension negotiation is not gated onIXWEBSOCKET_USE_ZLIB(only the codec is). A server built without the define would advertise compression it cannot perform, soimplies = { "zlib" }keeps every server build capable of what it advertises.Test coverage
New workspace member
tests/examples/websocket-features(deps withfeatures = ["server", "zlib"]), fully offline on loopback:ix::WebSocketServerround-trips (text + binary) through the compiled-in server.message.str.size() == 65536andwireSize == 80(the transport reportswireSize= raw frame payload,str= decompressed content).Negative verification: the default (no-feature) member's build has no
IXWebSocketServer.o/IXSocketServer.o/IXHttpServer.o/IXWebSocketProxyServer.o, andnmover all its objects finds no server symbols — referencing the server without the feature fails at link time.Verification (CI-pinned mcpp 2026.8.3.3 + gcc@16.1.0, MCPP_INDEX_MIRROR=GLOBAL, MCPP_BUILD_CACHE=local)
All lint scripts pass (syntax, required fields, no leading-v, mirror, package name, cross-package refs — the new
compat.zlibreference resolves).Follow-ups (not in this PR)
wss/TLS feature (deferred, per plan — the only one that meaningfully slows CI, viacompat.openssl).mcpp-reswrite access exists.