|
|
@@ -11,6 +11,23 @@ var boards = {
|
|
11
|
11
|
};
|
|
12
|
12
|
var boardName = "anonymous";
|
|
13
|
13
|
|
|
|
14
|
+function startIO(app) {
|
|
|
15
|
+ io = iolib.listen(app, {
|
|
|
16
|
+ 'flash policy port' : -1 //Makes flashsocket work even if the server doesn't accept connection on any port
|
|
|
17
|
+ });
|
|
|
18
|
+ //Default configuration
|
|
|
19
|
+ //io.enable('browser client minification'); // send minified client
|
|
|
20
|
+ io.enable('browser client etag'); // apply etag caching logic based on version number
|
|
|
21
|
+ io.enable('browser client gzip'); // gzip the file
|
|
|
22
|
+ io.set('log level', 1); // reduce logging
|
|
|
23
|
+
|
|
|
24
|
+ // enable all transports
|
|
|
25
|
+ io.set('transports', ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling']);
|
|
|
26
|
+
|
|
|
27
|
+ io.sockets.on('connection', socketConnection);
|
|
|
28
|
+ return io;
|
|
|
29
|
+}
|
|
|
30
|
+
|
|
14
|
31
|
function socketConnection (socket) {
|
|
15
|
32
|
|
|
16
|
33
|
socket.on("getboard", function() {
|
|
|
@@ -61,9 +78,7 @@ function generateUID (prefix, suffix) {
|
|
61
|
78
|
if (exports) {
|
|
62
|
79
|
exports.start = function(app) {
|
|
63
|
80
|
boards[boardName].data.on("ready", function() {
|
|
64
|
|
- io = iolib.listen(app, {'log':false});
|
|
65
|
|
- io.sockets.on('connection', socketConnection);
|
|
66
|
|
- return io;
|
|
|
81
|
+ startIO(app);
|
|
67
|
82
|
});
|
|
68
|
83
|
};
|
|
69
|
84
|
}
|