views:

81

answers:

1

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 ?

+1  A: 

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.

Adam Crossland
Yes, I have node.js server running....I just want to be able to get real-time update on my client through websocket without using browser at client side....basically, I want to have a client daemon process listening on real-time push message from my node.js server...I am using node at client side also...However, I am not sure how to make node process a deamon....node is non-blocking....while I am now asking client to be blocking(while loop on sock.onmessage).
haijin
@haijin: responded to you comment in my answer
Adam Crossland
I found the websock python lib which worked fine for my case..Good. http://freeasinbeard.org/post/1008785379/python-websocket-a-websocket-client-library-for
haijin
Yes, I used setInterval to print out received msg. However, after my main node.js program run through and exits, the callback no longer works. Also, periodical callback is more like a poll, not a push solution, which defeats the purpose of push based solution.
haijin