This example demonstrates LiveTemplate's WithWebSocketDisabled() mode. The client library is still included and handles all interactions — but uses HTTP fetch instead of WebSocket to send actions and receive tree-based DOM updates.
The LiveTemplate client library is included and works the same as in WebSocket mode:
<button name="action"> and <form name="action"> work identicallyThe client detects WebSocket availability by checking the X-LiveTemplate-WebSocket response header:
enabled — client connects via WebSocket (default)disabled — client falls back to HTTP fetchForms use method="POST" with button name routing, so the app still works without JavaScript via the POST-Redirect-GET pattern.
# Development mode (serves client library locally)
LVT_DEV_MODE=true go run .
Visit http://localhost:8080.
main.go — Controller, state, and action handlersws-disabled.tmpl — Template with standard HTML forms and client libraryws_disabled_test.go — Browser and HTTP e2e testsREADME.md — This documentation