add socket.io transports to configuration

This commit is contained in:
Riku Rouvila 2014-11-01 22:06:01 +02:00
parent c83a9d953a
commit 9416c492dd
2 changed files with 14 additions and 3 deletions

View File

@ -162,6 +162,13 @@ module.exports = {
// //
join: "#foo, #shout-irc" join: "#foo, #shout-irc"
}, },
//
// Set socket.io transports
//
// @type array
// @default ['polling', 'websocket']
//
transports: ['polling', 'websocket']
// //
// Run Shout with HTTPS support. // Run Shout with HTTPS support.

View File

@ -26,6 +26,7 @@ module.exports = function(options) {
var protocol = https.enable ? "https" : "http"; var protocol = https.enable ? "https" : "http";
var port = config.port; var port = config.port;
var host = config.host; var host = config.host;
var transports = config.transports || ['websocket', 'polling'];
if (!https.enable){ if (!https.enable){
server = require("http"); server = require("http");
@ -42,7 +43,10 @@ module.exports = function(options) {
require("./identd").start(config.identd.port); require("./identd").start(config.identd.port);
} }
sockets = io(server); sockets = io(server, {
transports: transports
});
sockets.on("connect", function(socket) { sockets.on("connect", function(socket) {
if (config.public) { if (config.public) {
auth.call(socket); auth.call(socket);