WebSocket的最佳工具有哪些?

huangapple go评论101阅读模式
英文:

What are the best tools for websocket?

问题

我在我的项目中使用Node.js进行通知。我使用socket.io和redis pub/sub。我喜欢socket.io,因为它为我提供了一种统一的接口,适用于各种传输方式(websocket、长轮询等),并且它还提供了跨浏览器的客户端库。但是,我在调试Node.js代码时遇到了很多问题。我经常遇到CPU问题,很难找出原因。这就是为什么我想使用其他工具代替Node.js,比如Go或Erlang,但我找不到这些语言上的类似socket.io的工具。

英文:

I have node.js for notifications in my project. I use socket.io and redis pub/sub. I like socket.io because it gives me one interface for all kind of transports (websocket, long polling and etc.) and it gives me crossbrowser client library. But I have a lot of problems with debuging code on nodejs. I have problems with cpu very often and its hard to figure out reason of it. That why I want to use tool instead of node.js maybe go or erlang but I can't find tools such as socket.io on these languages

答案1

得分: 3

我在几年前的一两年里参与了几个Node.js项目,我发现使用Go和调试Go项目要容易得多。但这更多是个人口味的问题。

Go有一个socket.io包

如果你只需要从服务器向浏览器传输数据,我建议你尝试一下Server Sent Events;也有几个很好的Go包可以用。例如esourceeventsource

英文:

I worked on several node.js projects over a year or two several years ago and I find working with Go and debugging Go projects much easier. But that's as much personal taste as anything else.

There is a socket.io package for Go.

If you only need data from the server to the browser I'd recommend you give Server Sent Events a try; there are several nice Go packages for that, too. For example esource or eventsource.

huangapple
  • 本文由 发表于 2014年1月17日 06:47:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/21174516.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定