Tag

bx-express

7 articles

Adding SSE and WebSockets to BoxExpress (and Everything That Broke Along the Way)

BoxExpress adds server-sent events and full WebSocket support for pushing live updates to clients — dashboards, progress bars, chat, notifications. Built from scratch, since BoxExpress skips BoxLang's built-in web layer. Along the way: a concurrency bug in broadcast connections, a header-injection-style hole in SSE metadata, a BoxLang update that broke page rendering, and a STOMP bug letting one client hijack another's subscription. All caught by trying to break it.

Robert Zehnder boxlang bx-express

BoxLang Express Development Update 8/26

BoxExpress 0.1.15→0.2.1: five patch releases fixed empty-value crashes (query/cookie/multipart), hardened proxy-IP trust for real platforms, fixed session data loss against non-memory stores, added response outcome accessors and opt-out session writes, and closed a trailing-slash bug hitting nearly every request. Then 0.2.0 replaced the JDK's HttpServer with Undertow entirely (breaking), verified at full parity and load-tested. 0.2.1 added live HTTP-layer metrics via getConnectorStatistics().

Robert Zehnder boxlang bx-express cli

Request Logging Middleware for bx-express

Robert replaced a synchronous third-party analytics service (which caused outages when rate-limited) with a custom `RequestLogger.bx` for his site. It uses a bounded in-memory queue, non-blocking middleware, and a background scheduled thread to batch-flush rows to SQL every 5s, with periodic cleanup of old records. Doubles as a boxlang-express middleware tutorial covering closures, Java interop (ConcurrentLinkedQueue, dynamic proxies), and defensive error handling.

Robert Zehnder boxlang bx-express cli

Watching a boxlang-express server: metrics, tuning, and a lighter image

This site runs on one 1-vCPU DigitalOcean instance with no APM vendor — just a self-built page reading JVM metrics directly, and the habit of watching it. Covers which numbers actually matter (GC time ÷ uptime, not raw seconds), a real bug caught along the way (the JVM thought it had 8 cores, not 1), load-testing to find the real throughput ceiling, and trimming the Docker image 60% by dropping CommandBox entirely.

Robert Zehnder boxlang bx-express cli

Things may look a little different

I rebuilt this blog on boxlang-express, my own Express.js-style BoxLang framework, moving from a CommandBox droplet to a thin DigitalOcean App container, with static assets on Cloudflare R2 and a homegrown MySQL access log replacing GoatCounter. Also: DismalThreads, my BoxLang/CBWire Reddit-style forum, is getting decommissioned end of month, no real users beyond my own test accounts, though the code may go public on GitHub.

Robert Zehnder boxlang bx-express cli

BoxLang Express Enhancements

BoxLang Express went from basic routing to a full-featured framework across 10 releases (0.1.1→0.1.14): sessions, CSRF, CORS, rate limiting, security headers, uploads, and a SQL-backed session store. Every fix got verified live before being called done, then locked in as one of 149 passing tests. Along the way, express-test grew from a chat demo into a live documentation site, catching stale docs and gotchas that reading alone would've missed.

Robert Zehnder boxlang bx-express cli