From 8f5671238080ab734406dd3e29b3129cd3d9ff93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2EFernando=20S=C3=A1nchez?= Date: Tue, 17 Apr 2012 23:43:33 +0200 Subject: [PATCH] Added dummy server to test socket.io connections --- .gitignore | 1 + hookio/dummyServer.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 hookio/dummyServer.js diff --git a/.gitignore b/.gitignore index 93eee72..e6484b5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ configuration node_modules *.bak *.swp +SOJA diff --git a/hookio/dummyServer.js b/hookio/dummyServer.js new file mode 100644 index 0000000..e534469 --- /dev/null +++ b/hookio/dummyServer.js @@ -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"); + }); +}); + +