## Summary
- **`ctx.upgrade()`** on the `Context` class with two overloads:
- **Bare mode**: `ctx.upgrade()` or `ctx.upgrade(options)` returns `{
socket, response }` for manual event wiring
- **Managed mode**: `ctx.upgrade(handlers)` accepts `{ open, message,
close, error }` and returns the upgrade `Response` directly
- **`app.ws(path, handlers, options?)`** shorthand that registers a GET
route with automatic WebSocket upgrade (managed mode only)
- Both support `idleTimeout` and `protocol` options forwarded to
`Deno.upgradeWebSocket()`
- Throws `HttpError(400)` on non-WebSocket requests
- Case-insensitive `Upgrade` header check per RFC 6455 §4.2.1
- Exports `WebSocketHandlers` and `WebSocketUpgradeOptions` types from
`fresh`
- Full documentation page with examples for managed mode, bare mode,
broadcast chat, and client-side usage
18 lines
691 B
Markdown
18 lines
691 B
Markdown
---
|
|
description: |
|
|
In this chapter of the Fresh documentation, you can find examples of features that you may like in your Fresh project.
|
|
---
|
|
|
|
In this chapter of the Fresh documentation, you can find examples of features
|
|
that you may like in your Fresh project.
|
|
|
|
- [API Routes](./examples/api-routes)
|
|
- [DaisyUI](./examples/daisyui)
|
|
- [Rendering Markdown](./examples/markdown)
|
|
- [Rendering raw HTML](./examples/rendering-raw-html)
|
|
- [Sharing state between islands](./examples/sharing-state-between-islands)
|
|
- [Active links](./examples/active-links)
|
|
- [Session management](./examples/session-management)
|
|
- [WebSockets](./examples/websockets)
|
|
- [Common Patterns](./examples/common-patterns)
|