node.js是否有服务器端Websocket客户端?

时间:2022-03-01 16:08:48

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?

我一直在使用socket.io在node.js中创建一个支持websocket的服务器,它很棒。但是,现在我想在node.js中创建一个服务器端客户端,它可以连接到其他地方的websocket服务器。那里有没有图书馆?

Thanks

谢谢

3 个解决方案

#1


4  

https://github.com/pgriess/node-websocket-client <-- does this one work for you?

https://github.com/pgriess/node-websocket-client < - 这个适合你吗?

Found on this list here: https://github.com/joyent/node/wiki/modules

在此列表中找到:https://github.com/joyent/node/wiki/modules

#2


2  

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

我几天前在邮件列表上与Guillermo谈过这个问题,请参阅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

我写这个作为引导来帮助我测试: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

吉列尔莫正在努力争取0.7:https://github.com/LearnBoost/Socket.IO-node-client

#3


1  

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.

我刚刚开始研究一个有类似需求的项目:一个Node服务器,它充当Socket.io服务器,并通过适当的websockets连接到另一个服务。我在Node中使用了ws模块作为websocket客户端。

Do be aware that, as noted above by Josh, Socket.io is a protocol on top of web sockets.

请注意,如上面Josh所述,Socket.io是一个基于Web套接字的协议。

#1


4  

https://github.com/pgriess/node-websocket-client <-- does this one work for you?

https://github.com/pgriess/node-websocket-client < - 这个适合你吗?

Found on this list here: https://github.com/joyent/node/wiki/modules

在此列表中找到:https://github.com/joyent/node/wiki/modules

#2


2  

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

我几天前在邮件列表上与Guillermo谈过这个问题,请参阅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

我写这个作为引导来帮助我测试: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

吉列尔莫正在努力争取0.7:https://github.com/LearnBoost/Socket.IO-node-client

#3


1  

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.

我刚刚开始研究一个有类似需求的项目:一个Node服务器,它充当Socket.io服务器,并通过适当的websockets连接到另一个服务。我在Node中使用了ws模块作为websocket客户端。

Do be aware that, as noted above by Josh, Socket.io is a protocol on top of web sockets.

请注意,如上面Josh所述,Socket.io是一个基于Web套接字的协议。