/Knowledge/sources/honojs__hono/llms-full/websocket-helper-import--52fa62501edd.md
WebSocket Helper: Import - hono-docs
WebSocket Helper: Import Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt import Summary ::: code group...
WebSocket Helper: Import
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#import
Summary
::: code-group ts [Cloudflare Workers] import { Hono } from 'hono' import { upgradeWebSocket } from 'hono/cloudflare-workers' ts [Deno] import { Hono } from 'hono' import { upgradeWebSocket } from 'hono/deno' ```ts [Bun] im...
Content
::: code-group
import { Hono } from 'hono'
import { upgradeWebSocket } from 'hono/cloudflare-workers'
import { Hono } from 'hono'
import { upgradeWebSocket } from 'hono/deno'
import { Hono } from 'hono'
import { upgradeWebSocket, websocket } from 'hono/bun'
// ...
export default {
fetch: app.fetch,
websocket,
}
import { serve, upgradeWebSocket } from '@hono/node-server'
import { Hono } from 'hono'
import { WebSocketServer } from 'ws'
:::
On Node.js, WebSocket support is built into @hono/node-server. To enable it, install ws and, if you use TypeScript, @types/ws. Then create a WebSocketServer with { noServer: true } and pass it to serve() via the websocket option.
@hono/node-ws is deprecated.
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#import",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / WebSocket Helper > Import",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 707,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "WebSocket Helper: Import",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}