Is there a browserless websocket client for Node.js that does not need to use a browser?

后端 未结 5 1674
渐次进展
渐次进展 2020-12-08 17:13

Socket.IO, etc all require the using of browser on the client side....just wondering, how can we have browserless websocket client for node.js ?

5条回答
  •  Happy的楠姐
    2020-12-08 17:39

    A Node.js server is in no way bound to a web browser as a client. Any program can use whatever socket library is provided by its supporting libraries to make a call to a Node.js server.

    EDIT

    Responding to your comment: don't forget that Node.js is Javascript! If you want to execute code periodically -- in much the same way that a daemon process might -- you can use setInterval to run a callback every n milliseconds. You should be able to do it right there in your node program.

提交回复
热议问题