TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Eventserver: broadcast HTML(5) server-sent events with JSON

3 点作者 thomaslee大约 14 年前

1 comment

thomaslee大约 14 年前
Disclaimer: I'm the original author of eventserver and an employee of Shine Technologies. These are my thoughts, I'm not speaking on their behalf, yadda yadda yadda.<p>I wrote this over the course of a couple of hours yesterday morning based on thoughts I'd been having for a few weeks about HTML(5) server-sent events and the possibilities that come with it.<p>eventserver effectively listens on two ports: a "publisher" port and a "subscriber" port. The subscriber port implements the interesting bits of the server-sent events working draft. The "publisher" port simply accepts (JSON) messages over HTTP. These messages are then forwarded to all connected subscribers using the server-sent event protocol.<p>The server itself is written in NodeJS, messages are not stored, and things like Last-Event-ID are not (yet?) implemented. Just a toy for now, but perhaps an interesting one all the same!