totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

websocket Connect Error: Error: socket hang up #23

Closed KiPSOFT-zz closed 11 years ago

KiPSOFT-zz commented 11 years ago

hi again;

i'm testing websocket but have a problem.

my module code:

exports.install = function(framework) {
        framework.websocket("/", socket, ["json"]);
}

function socket(controller, framework) {    
    console.log("hi");
}

and my client code;

#!/usr/bin/env node
var WebSocketClient = require('websocket').client;

var client = new WebSocketClient();

client.on('connectFailed', function(error) {
     console.log('Connect Error: ' + error.toString());
});

client.connect('ws://127.0.0.1:3000/', "json");

i'm getting this error. Warning: Native modules not compiled. XOR performance will be degraded. Warning: Native modules not compiled. UTF-8 validation disabled. Connect Error: Error: socket hang up

my system windows8 - x64

whats my problem ?

thanks.

petersirka commented 11 years ago

Hi @KiPSOFT, test your code through Chrome or Firefox.

This works without problems: http://www.partialjs.com/upload/chat.zip


Is possible that node.js WebSocket (module) doesn't support (RFC 6455 standard).

KiPSOFT-zz commented 11 years ago

yes this chat application good work but my node.js client application not connect server. i'm using this websocket module https://github.com/Worlize/WebSocket-Node

petersirka commented 11 years ago

I don't know where is the problem. partial.js supports: standard RFC 6455, plain text (frame)

You must test all options. Sorry.

KiPSOFT-zz commented 11 years ago

i solve my problem. wrong origin. thanks.