Bun runtime now accepts Bun.serve as an entrypoint
Vercel Functions now support Bun.serve as a native entrypoint, allowing you to deploy servers with WebSocket support as-is without framework wrapping. Servers use Fluid compute with per-message pricing for WebSocket connections.
The for Vercel Functions now supports as a function entrypoint, including WebSocket handlers. The server you run locally with Bun deploys as-is, without being wrapped in a framework.Bun runtimeBun.serve()
Enable the runtime by setting in ."bunVersion": "1.x"vercel.json
Create a server with a map in at the project root.routesserver.ts
Add a handler and call in to upgrade matching requests. The rest of the server stays the same.websocketserver.upgrade(request)fetch
WebSocket connections run on with , so you pay only for time spent processing messages, not idle connection time. A connection is pinned to one function instance for its lifetime, and a single instance can handle multiple concurrent connections. Use an external data store to coordinate messages across instances.Fluid computeActive CPU pricing
Read the to get started.documentation
Deploy a routes-based server
Accept WebSocket connections
Source: original entry ↗