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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: How do you stream events from your node server to web app?

2 点作者 theo31超过 7 年前
I am looking to send events from my node server to my react app. However, I don&#x27;t want anybody to be able listen to the events.<p>I&#x27;ve looked into redis pub&#x2F;sub and google pub&#x2F;sub but they seem either awfully complicated (gcloud) or hard to implement (redis doesn&#x27;t have a browser client).<p>What should I use?

1 comment

applecrazy超过 7 年前
I don&#x27;t know what you mean by &quot;I don&#x27;t want anybody to be able listen to the events,&quot; since web apps can always be taken apart using the dev tools (including the network requests). But, putting that aside for a second, since you want a node server to send events to your react app, socket.io (open source, MIT license) should be able to help you. It works with node and you can bind it to a Component&#x27;s state.<p><a href="https:&#x2F;&#x2F;socket.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;socket.io&#x2F;</a>