Skip to content

v0.4.0 — connection hijack / upgrade foundation

Choose a tag to compare

@Tuntii Tuntii released this 19 Jul 12:05

Viltrum v0.4.0

Connection hijack foundation for custom protocols (pre-WebSocket). Cleartext HTTP/1.1 remains first-class; reverse proxy for TLS is still fine.

Engine / upgrade

  • engine.Conn: read/write/close/deadlines + pushback buffer for post-message bytes
  • Conn.peer_ip for upgrade/logging
  • app.upgrade(method, pattern, handler) — single hijack path; HTTP loop stops for that conn
  • viltrum.switching_protocols for bare 101 responses
  • ServerOptions.max_conns — excess accepts get 503 + close
  • read_header_timeout, send_date, server_header (opt-in; do not overwrite handler headers)
  • http.http_date / viltrum.http_date for IMF-fixdate
  • TE + Content-Length conflict → 400

Docs & example

  • docs/upgrade.md — leftover ownership, shutdown behaviour
  • docs/connection.md, docs/deploy.md, docs/request-response.md, ROADMAP.md
  • examples/upgrade_echo

Tests

  • v test http/ · router/ · engine/ (TCP integration + Conn pushback unit tests)
  • CI builds upgrade_echo

From 0.3.x polish (included)

  • Chunked/TE reject; Expect 100-continue; HEAD body omit + GET fallback
  • Absolute-form target, OPTIONS *; patch / options / head
  • App.server_options (renamed from options for ServerOptions)

Next

v0.5 — WebSocket (ws://) on this upgrade path. Interest: interest:websocket Collect WebSocket (ws://) use-cases; no implementation in 0.3.x

Full notes: CHANGELOG.md · ROADMAP.md