Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/vercel/examples
/ onMessage
Function
onMessage
websockets/hono/src/server.ts:22–26 ·
view source on GitHub ↗
(event, ws)
Source
from the content-addressed store, hash-verified
20
'/ws'
,
21
upgradeWebSocket(() => ({
22
onMessage(event, ws) {
23
const
message = String(event.data ??
''
).trim()
24
if
(!message)
return
25
ws.send(`server: ${message}`)
26
},
27
})),
28
)
29
Callers
1
useAgentStream
Function · 0.85
Calls
1
send
Method · 0.65
Tested by
no test coverage detected