1
0
mirror of https://github.com/balkian/Web4.0.git synced 2024-11-05 00:31:42 +00:00

Added dummy server to test socket.io connections

This commit is contained in:
J.Fernando Sánchez 2012-04-17 23:43:33 +02:00
parent f492485146
commit 8f56712380
2 changed files with 13 additions and 0 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ configuration
node_modules
*.bak
*.swp
SOJA

12
hookio/dummyServer.js Normal file
View File

@ -0,0 +1,12 @@
var io = require('socket.io').listen(3000);
io.sockets.on('connection', function (socket) {
console.log("New connection!");
socket.on('test', function (data,ack) {
console.log(data);
var testObject = {"testKey" : "testValue", "testArray": ["value1", "value2", "value3"], "testDic": {"key1":"value1","key2":"value2"}, "testMix":["one",{"twoDic":["one","two"]}]};
ack(testObject);
console.log("I acked");
});
});