Node.js 有服务器端 Websocket 客户端吗?
我一直在使用socket.io 在node.js 中创建一个支持websocket 的服务器,它非常棒。现在我想在 node.js 中创建一个服务器端客户端,它可以连接到其他地方的 websocket 服务器。有没有相关的图书馆?
谢谢
I've been using socket.io to create a websocket enabled server in node.js, and its great. Now i'd like however, to create a server-side client in node.js which can connect to a websocket server elsewhere. Are there any libraries out there for this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
https://github.com/pgriess/node-websocket-client <--这个对你有用吗?
在此列表中找到:https://github.com/joyent/node/wiki/modules
https://github.com/pgriess/node-websocket-client <-- does this one work for you?
Found on this list here: https://github.com/joyent/node/wiki/modules
没有一个是伟大的。
几天前,我在邮件列表上与 Guillermo 讨论过此事,请参阅 http:// groups.google.com/group/socket_io/browse_thread/thread/74e9ff6d7e931f6e
我将其编写为引导程序以帮助我进行测试:
https://github.com/jmoyers/mettle /blob/master/test/test-socket.coffee#L18-49
Guillermo 正在开发一个 0.7 版本:
https://github.com/LearnBoost/Socket.IO-node-client
Not any that are great.
I talked to Guillermo about this on mailing list a couple days ago, see http://groups.google.com/group/socket_io/browse_thread/thread/74e9ff6d7e931f6e
I wrote this as a bootstrap to help in my testing:
https://github.com/jmoyers/mettle/blob/master/test/test-socket.coffee#L18-49
Guillermo is working on one here for 0.7:
https://github.com/LearnBoost/Socket.IO-node-client
我刚刚致力于一个具有类似需求的项目:一个充当 Socket.io 服务器并通过适当的 websocket 连接到另一个服务的 Node 服务器。我在 Node.js 中使用了
ws
模块作为 Websocket 客户端。请注意,正如 Josh 上面所指出的,Socket.io 是一个基于 Web 套接字的协议。
I've just been working on a project with similar needs: a Node server that acts as a Socket.io server and connects to another service via proper websockets. I used the
ws
module for the websocket client in Node.Do be aware that, as noted above by Josh, Socket.io is a protocol on top of web sockets.