got clustering to work with socket.io
deleted: dump.rdb modified: config/socket.io.js new file: dump.rdb modified: package.json modified: public/dist/application.js modified: public/dist/application.min.js modified: public/modules/core/services/socket.io.client.service.js modified: public/modules/forms/directives/analytics-service.client.directive.js deleted: dump.rdb
This commit is contained in:
parent
dfb51d8117
commit
a6f8b283e0
|
@ -11,8 +11,9 @@ var config = require('./config'),
|
|||
module.exports = function (app, db) {
|
||||
var server = http.createServer(app);
|
||||
|
||||
// Create a new Socket.io server
|
||||
var io = socketio.listen(server);
|
||||
var io = socketio(config.socketPort, { transports: ['websocket', 'polling'] });
|
||||
var redis = require('socket.io-redis');
|
||||
io.adapter(redis({ host: '127.0.0.1', port: 6379 }));
|
||||
|
||||
// Add an event listener to the 'connection' event
|
||||
io.on('connection', function (socket) {
|
||||
|
|
|
@ -84,6 +84,7 @@
|
|||
"raven": "^0.9.0",
|
||||
"soap": "^0.11.0",
|
||||
"socket.io": "^1.4.6",
|
||||
"socket.io-redis": "^1.0.0",
|
||||
"swig": "~1.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
8
public/dist/application.js
vendored
8
public/dist/application.js
vendored
|
@ -727,14 +727,13 @@ angular.module('core').service('Menus', [
|
|||
socket: null
|
||||
};
|
||||
|
||||
console.log('https://'+window.location.hostname+':'+$window.socketPort);
|
||||
connect('https://'+window.location.hostname+':'+$window.socketPort);
|
||||
connect(window.location.protocol+'//'+window.location.hostname+':'+$window.socketPort);
|
||||
|
||||
return service;
|
||||
|
||||
// Connect to Socket.io server
|
||||
function connect(url) {
|
||||
service.socket = io();
|
||||
service.socket = io({'transports': ['websocket', 'polling']});
|
||||
}
|
||||
|
||||
// Wrap the Socket.io 'emit' method
|
||||
|
@ -1115,7 +1114,6 @@ angular.module('forms').controller('SubmitFormController', ['$scope', '$rootScop
|
|||
// Create a controller method for sending visitor data
|
||||
function send(form, lastActiveIndex, timeElapsed) {
|
||||
|
||||
console.log(lastActiveIndex);
|
||||
// Create a new message object
|
||||
var visitorData = {
|
||||
referrer: document.referrer,
|
||||
|
@ -1137,7 +1135,7 @@ angular.module('forms').controller('SubmitFormController', ['$scope', '$rootScop
|
|||
var service = {
|
||||
send: send
|
||||
};
|
||||
|
||||
|
||||
init();
|
||||
return service;
|
||||
|
||||
|
|
4
public/dist/application.min.js
vendored
4
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -17,14 +17,13 @@
|
|||
socket: null
|
||||
};
|
||||
|
||||
console.log('https://'+window.location.hostname+':'+$window.socketPort);
|
||||
connect('https://'+window.location.hostname+':'+$window.socketPort);
|
||||
connect(window.location.protocol+'//'+window.location.hostname+':'+$window.socketPort);
|
||||
|
||||
return service;
|
||||
|
||||
// Connect to Socket.io server
|
||||
function connect(url) {
|
||||
service.socket = io();
|
||||
service.socket = io(url, {'transports': ['websocket', 'polling']});
|
||||
}
|
||||
|
||||
// Wrap the Socket.io 'emit' method
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
// Create a controller method for sending visitor data
|
||||
function send(form, lastActiveIndex, timeElapsed) {
|
||||
|
||||
console.log(lastActiveIndex);
|
||||
// Create a new message object
|
||||
var visitorData = {
|
||||
referrer: document.referrer,
|
||||
|
@ -35,7 +34,7 @@
|
|||
var service = {
|
||||
send: send
|
||||
};
|
||||
|
||||
|
||||
init();
|
||||
return service;
|
||||
|
||||
|
|
Loading…
Reference in a new issue