Hello,

I try to setup two node.js servers communication with each other over 
socket.io. The node servers use SSL, but I don't get it running. I do not 
get any feedback, its close to this:

Node.js socket.io-client connect_failed event 
<http://stackoverflow.com/questions/8588689/node-js-socket-io-client-connect-failed-event>

This will not work. No response.

var clientio = require('socket.io-client');
console.log('Trying stuff ...');
// the channel does not existvar socket = clientio.connect( 
'http://localhost:4000/news' );
// I expect this event to be triggered
socket.on('connect_failed', function(){
    console.log('Connection Failed');});
socket.on('connect', function(){
    console.log('Connected');});
socket.on('disconnect', function () {
  console.log('Disconnected');});

but if I try:

// Bind to the news namespace, also get the underlying socketvar ns_news = 
clientio.connect( 'https://localhost:9000' );var socket = ns_news.socket
// Global events are bound against socket
socket.on('connect_failed', function(){
    console.log('Connection Failed');});
socket.on('connect', function(){
    console.log('Connected');});
socket.on('disconnect', function () {
  console.log('Disconnected');});
// Your events are bound against your namespace(s)
ns_news.on('myevent', function() {
    // Custom event code here});

I can see that ns_news has no element socket, so I get:

TypeError: Cannot call method 'on' of undefined

So how do I connect these two servers with feedback if the connection is 
successful or not? And my following question would be:

How can these two servers authenticate to each other? Means: Server A says 
to server B: - hey, gimme that secret string And Server B checks the 
certificate of server A and if it's ok - here's the string

How do I do it with node?

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/07d82ad9-8aa0-4ff9-8f7b-849dbbfd3e94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to