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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Socket.IO P2P

180 点作者 Rauchg将近 10 年前

7 条评论

angersock将近 10 年前
It&#x27;d be nice if the socket.io project spent less time adding features and more time just documenting what they have.<p>Does anybody have a small, fast, no-bullshit, modern websockets library they&#x27;d nominate for use with node?
评论 #9892300 未加载
评论 #9892498 未加载
评论 #9892635 未加载
评论 #9893001 未加载
评论 #9892692 未加载
评论 #9895400 未加载
评论 #9892943 未加载
评论 #9892935 未加载
Jamie452将近 10 年前
Personally I think PeerJS is a much more mature, robust and better documented solution.<p><a href="http:&#x2F;&#x2F;peerjs.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;peerjs.com&#x2F;</a><p>Last time I checked PeerJS also provides support for handling TURN&#x2F;ICE&#x2F;STURN.
评论 #9902174 未加载
peregrine将近 10 年前
Is it documented anywhere how they handle TURN&#x2F;ICE&#x2F;STURN for dealing with firewalls and routers?<p>EDIT: Looks like it doesn&#x27;t. This is basically just a very small library on top of socket.io. Look forward to them helping solve the TURN&#x2F;ICE&#x2F;STUN issues :(
评论 #9892695 未加载
s986s将近 10 年前
I&#x27;m humored by the fact that this example isn&#x27;t working for me.
marknadal将近 10 年前
Too bad the demo doesn&#x27;t work, I was really excited for this. Regardless, big congratulations to the Socket.IO team for an awesome feature! And props to Feross for his simple-peer module, he is doing incredible work in the WebRTC world.<p>In other news, to address some of the comments here:<p>- As others have mentioned, <a href="https:&#x2F;&#x2F;github.com&#x2F;sockjs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sockjs</a> is an alternative that is more lean with less features.<p>- I&#x27;ve also written an inverse websocket tool that behaves like a regular HTTP request&#x2F;response, but will proxy it through WebSockets or fallback to JSONP. I really like this approach because it feels more RESTful, has less overhead, and even allows the browser to do a `createServer`. It is currently pretty tightly coupled into a project of mine (next bullet), I&#x27;ll try pulling it out into its own library if there is demand, but here is the source:<p>- - Client library, <a href="https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;gun.js#L1138" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;gun.js#L1138</a> and onwards.<p>- - Server library, <a href="https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;lib&#x2F;wsp.js#L8" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;lib&#x2F;wsp.js#L8</a> and onwards.<p>- - Really nifty HTTP normalizer, <a href="https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;lib&#x2F;http.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;lib&#x2F;http.js</a> .<p>- - Really nifty WebSocket normalizer, same format, <a href="https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;lib&#x2F;ws.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;lib&#x2F;ws.js</a> .<p>- - Really nifty JSONP normalizer, same format, <a href="https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;lib&#x2F;jsonp.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun&#x2F;blob&#x2F;master&#x2F;lib&#x2F;jsonp.js</a> .<p>- If you do use the P2P Socket.IO feature, the next thing you&#x27;ll need is a P2P database that can run in the browser! And that is what my main open source project, <a href="http:&#x2F;&#x2F;gunDB.io&#x2F;" rel="nofollow">http:&#x2F;&#x2F;gunDB.io&#x2F;</a> is about. The previous bullet&#x27;s code is my nimble websocket and fallback library I wrote for this project, and that is why they are currently tightly coupled - sorry about that. If there is enough demand for it by itself then I&#x27;ll try making it into its own library.<p>Cheers!
1qaz2wsx3edc将近 10 年前
Neat, when can we expect a DHT (distributed hash table) for decentralization? ;)
评论 #9894615 未加载
评论 #9894176 未加载
irascible将近 10 年前
Can I use this to send udp+tcp between clients and servers?