简体   繁体   中英

Connect to a socket.io node.js server from a node.js console program

Let me explain the setup a bit more. I have socket.io running inside a node.js server.

I want to connect to this server from another node.js program that is running in the console (outside the browser).

All examples that I have seen so far only talk about a socket.io client that is running inside a browser, but I want to connect to a console program which is outside the browser.

Is it possible to do something like this?

No problem, use socket.io-client

more info here: https://github.com/LearnBoost/socket.io-client

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM