EPISODE · Jun 22, 2026 · 1 MIN
@vercel_dev:Vercel 平台正式支援 WebSockets,讓開發者能透過標準 Node.js 函式庫建構即時互動應用。 核心功能更新 Vercel 於 2026…
from EasyVibeCoding Podcast · host Vercel Developers
Vercel 平台正式支援 WebSockets,讓開發者能透過標準 Node.js 函式庫建構即時互動應用。 核心功能更新 Vercel 於 2026 年 6 月 22 日宣布其 Functions 正式進入 WebSockets 公開測試階段,這項更新允許使用者在 Vercel 上建立雙向通訊機制。開發者現在可以運用標準的 Node.js 函式庫(如 ws)或高階框架(如 socket.io)來開發需要即時互動的應用程式,例如 AI 串流、聊天室或協作工具。 技術架構與計費 此功能整合於 Vercel 的 Fluid compute 架構中,並遵循與一般 Function 呼叫相同的限制與定價規則。在計費方面,Vercel 採用 Active CPU 定價模式,這意味著系統僅會針對 Function 處理訊息的實際運作時間進行收費,不會針對閒置的連線時間計費。 實作範例 開發者無需額外設定,即可直接在專案中部署 WebSocket 伺服器。以下為使用 express 與 ws 函式庫的範例程式碼: api/ws.ts `ts import express from 'express'; import { createServer } from 'http'; import { WebSocketServer } from 'ws'; const app = express(); const server = createServer(app); const wss = new WebSocketServer({ server }); wss.on('connection', (ws) => { ws.on('message', (data) => { ws.send(data); }); }); export default server; ` 欲深入了解詳細規格與部署方式,可參考 Vercel 官方文件 以獲取更多資訊。原文:https://easyvibecoding.app/curated/2152
Embed this episode
Ready to play
@vercel_dev:Vercel 平台正式支援 WebSockets,讓開發者能透過標準 Node.js 函式庫建構即時互動應用。 核心功能更新 Vercel 於 2026…
No transcript for this episode yet
Similar Episodes
No similar episodes found.
Similar Podcasts
No similar podcasts found.