MudEngine Part 10: Desktop with Blitz
Run the native client
The server/client split works differently with the Blitz renderer. Since dioxus-native builds a native binary (not WASM), dx serve --desktop doesn't apply here — that command uses the wry-based desktop renderer.
Instead, we run the server and client as separate binaries. The dx serve command compiles and starts the Axum server. The native client is a separate process that connects to it.
Terminal 1: Start the server
dx serveThe dx serve command compiles the server binary (with --features server) and the web client WASM bundle (the default). It starts the Axum server on port 8080.
The native client doesn't need to be compiled by dx — it's a separate cargo run invocation.
In a second terminal, run the native client directly with cargo:
cargo runcargo runcompiles the project without theserverfeature- The native arm runs
set_server_url("http://localhost:8080") dioxus_native::launch_cfg(App, vec![], vec![Box::new(cfg)])opens a winit window with the Blitz renderer- The renderer loads your CSS from
assets/main.css(viadocument::Stylesheet) — but through Blitz's own CSS parser, not a browser's - The WebSocket connects to the server at localhost:8080
- The MUD UI renders — name screen, grid, sidebar, D-pad — all drawn by WGPU/Vello
Open http://localhost:8080 in a browser alongside the native window to see both clients sharing the same game world.
To be clear: the desktop window never starts the server. It is a pure client — cargo run only opens the window; the game server must already be running in the other terminal (dx serve). This is why two terminals are mandatory, not optional.
Once the window is open, the wiring is identical to the browser client:
set_server_url("http://localhost:8080")points every fullstack request (HTTP + WebSocket) at the Axum server. Without it the native client has no "origin" to talk to.- The name screen renders locally — no network needed yet.
- Clicking Enter the World runs
use_websocket'sconnectserver function: an HTTP upgrade handshake againstlocalhost:8080opens the same WebSocket the WASM client uses. - From there it's the normal protocol:
ClientMessage::Join(name)up,ServerMessagebroadcasts down.
So the browser tab and the desktop window are peers on one server — neither is the server. If dx serve isn't running, the name screen still shows, but joining hangs.
The native window will have:
- OS chrome — standard title bar, close/minimize/maximize buttons (provided by winit)
- Dark background — the CSS gradient from
assets/main.cssrendered by Vello - No address bar — it's a native app, not a browser
- GPU-accelerated rendering — the WGPU backend uses Vulkan (Linux/Windows), Metal (macOS), or DX12 (Windows)
Because Blitz is experimental, several CSS features used by the MUD may not render correctly:
linear-gradientbackgrounds — may appear as a solid colourbox-shadow— may be missing or incorrecttransition/animation— not implemented yetposition: fixed— the floating player list may not stay pinnedfilter: brightness()— may not work on hover@keyframes— the quest pulse animation won't animate
The UI will still be functional — the grid, buttons, input, and chat will work. It may just look slightly different from the browser version.
This is the nature of an experimental renderer. Each week the Blitz team ships more CSS support.