aboutsummaryrefslogtreecommitdiff
path: root/xmake.lua
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-12 15:03:03 +0100
committerGitHub Enterprise <[email protected]>2026-03-12 15:03:03 +0100
commit81bc43aa96f0059cecb28d1bd88338b7d84667f9 (patch)
treea3428cb7fddceae0b284d33562af5bf3e64a367e /xmake.lua
parentupdate fmt 12.0.0 -> 12.1.0 (#828) (diff)
downloadzen-81bc43aa96f0059cecb28d1bd88338b7d84667f9.tar.xz
zen-81bc43aa96f0059cecb28d1bd88338b7d84667f9.zip
Transparent proxy mode (#823)
Adds a **transparent TCP proxy mode** to zenserver (activated via `zenserver proxy`), allowing it to sit between clients and upstream Zen servers to inspect and monitor HTTP/1.x traffic in real time. Primarily useful during development, to be able to observe multi-server/client interactions in one place. - **Dedicated proxy port** -- Proxy mode defaults to port 8118 with its own data directory to avoid collisions with a normal zenserver instance. - **TCP proxy core** (`src/zenserver/proxy/`) -- A new transparent TCP proxy that forwards connections to upstream targets, with support for both TCP/IP and Unix socket listeners. Multi-threaded I/O for connection handling. Supports Unix domain sockets for both upstream/downstream. - **HTTP traffic inspection** -- Parses HTTP/1.x request/response streams inline to extract method, path, status, content length, and WebSocket upgrades without breaking the proxied data. - **Proxy dashboard** -- A web UI showing live connection stats, per-target request counts, active connections, bytes transferred, and client IP/session ID rollups. - **Server mode display** -- Dashboard banner now shows the running server mode (Zen Proxy, Zen Compute, etc.). Supporting changes included in this branch: - **Wildcard log level matching** -- Log levels can now be set per-category using wildcard patterns (e.g. `proxy.*=debug`). - **`zen down --all`** -- New flag to shut down all running zenserver instances; also used by the new `xmake kill` task. - Minor test stability fixes (flaky hash collisions, per-thread RNG seeds). - Support ZEN_MALLOC environment variable for default allocator selection and switch default to rpmalloc - Fixed sentry-native build to allow LTO on Windows
Diffstat (limited to 'xmake.lua')
-rw-r--r--xmake.lua22
1 files changed, 18 insertions, 4 deletions
diff --git a/xmake.lua b/xmake.lua
index dfe383c1a..e9bed93aa 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -130,11 +130,8 @@ enable_unity = false
if is_mode("release") then
-- LTO does not appear to work with the current Linux UE toolchain
- -- It's currently also temporarily disabled on Windows to investigate
- -- build issues due to git apply not applying the necessary patches correctly
- -- in CI for some reason.
-- Also, disabled LTO on Mac to reduce time spent building openssl tests
- if not is_plat("linux", "windows", "macosx") then
+ if not is_plat("linux", "macosx") then
set_policy("build.optimization.lto", true)
end
set_optimize("fastest")
@@ -352,6 +349,23 @@ task("bundle")
bundle()
end)
+task("kill")
+ set_menu {
+ usage = "xmake kill",
+ description = "Terminate any running zenserver instances",
+ }
+ on_run(function ()
+ local ok = try { function() os.execv("xmake", {"run", "zen", "down", "--all"}) end }
+ if ok then return end
+ if is_host("windows") then
+ ok = try { function() os.runv("taskkill", {"/F", "/IM", "zenserver.exe"}) end }
+ if ok then print("zenserver terminated") end
+ else
+ ok = try { function() os.runv("pkill", {"-f", "zenserver"}) end }
+ if ok then print("zenserver terminated") end
+ end
+ end)
+
task("updatefrontend")
set_menu {
usage = "xmake updatefrontend",