Episode 1121 minutes

RFC 6455 Real-Time WebSockets (@ws) & Pure-HADID HTML Templates

Master the auto-XSS html_render template engine, traversal-safe web_static assets, and built-in @ws RFC 6455 WebSockets.

Lesson Video Coming Soon

This episode's HD lesson video will appear directly in this player once published. Meanwhile, run and modify the live HADID v0.13 code lab right below!

Learning Objectives

  • Render XSS-safe server HTML using {{var}}, {{{raw}}}, {{#if}}, and {{#each}}
  • Build live multi-client WebSocket rooms using @ws, ws_send, ws_recv, and ws_broadcast
  • Serve static CSS/JS safely with traversal-protected web_static

Architecture Summary

HADID v0.13 unlocks pure-HADID full-stack real-time web apps. html_render auto-escapes all {{field}} values against XSS, and @ws routes run a pure ISO C17 RFC 6455 WebSocket engine with masked frames, Ping/Pong, and multi-client broadcast.

Live HADID v0.13 Code Lab

LIVE COMPILER

Episode 11 · Interactive Lab

Live Native C17 · v0.13.0
main.had

Run with Ctrl / ⌘ + Enter

Executes on the real HADID v0.13.0 Linux compiler inside a network-isolated container (async/await, closures, Generic fn<T> + where, Query<T>, loop-fused lambdas, html_render, crypto, SQLite :memory:, and full EN/TR syntax). Use the local `hadid` CLI for disk SQLite, live WebSocket/HTTP servers, and native AOT binaries.

Sign in with Digital HAT ID to earn Code Lab (+25 XP), Quiz (+50 XP), badges, and certificates.Sign In

Knowledge Check

1. What happens to <script> inside {{user_input}} when rendered by html_render?