I would like to implement a TCP socket connection to an anonymous server{ chat.facebook.com:5222 } from a nodejs server . How / Where from do i start for this to be accomplished ?
It should be like a node replacement to fsockopen() function of PHP.
The documentation for net.Socket is where you should start. In general, you can connect to a server like this:
var net = require('net');
var socket = new net.Socket();
socket.on('connect', function() {
// socket is now connected
});
socket.on('data', function(data) {
// socket got some data
});
socket.connect(5222, 'chat.facebook.com');