Merge pull request #267 from rikukissa/master
Add socket.io transports to configuration
This commit is contained in:
commit
ac6aeaeba2
|
@ -170,6 +170,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.
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue