mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
Fixed admin panel from not loading
This commit is contained in:
parent
a3107c4e39
commit
a8ff9d5667
1 changed files with 20 additions and 12 deletions
|
@ -7,7 +7,7 @@ const express = require('../express');
|
||||||
const log4js = require('log4js');
|
const log4js = require('log4js');
|
||||||
const proxyaddr = require('proxy-addr');
|
const proxyaddr = require('proxy-addr');
|
||||||
const settings = require('../../utils/Settings');
|
const settings = require('../../utils/Settings');
|
||||||
const {Server} = require('socket.io');
|
import {Server} from 'socket.io'
|
||||||
const socketIORouter = require('../../handler/SocketIORouter');
|
const socketIORouter = require('../../handler/SocketIORouter');
|
||||||
const hooks = require('../../../static/js/pluginfw/hooks');
|
const hooks = require('../../../static/js/pluginfw/hooks');
|
||||||
const padMessageHandler = require('../../handler/PadMessageHandler');
|
const padMessageHandler = require('../../handler/PadMessageHandler');
|
||||||
|
@ -96,21 +96,29 @@ exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Functio
|
||||||
maxHttpBufferSize: settings.socketIo.maxHttpBufferSize,
|
maxHttpBufferSize: settings.socketIo.maxHttpBufferSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
io.on('connection', (socket:any) => {
|
function handleConnection() {
|
||||||
sockets.add(socket);
|
return (socket: any) => {
|
||||||
socketsEvents.emit('updated');
|
sockets.add(socket);
|
||||||
// https://socket.io/docs/v3/faq/index.html
|
|
||||||
const session = socket.request.session;
|
|
||||||
session.connections++;
|
|
||||||
session.save();
|
|
||||||
socket.on('disconnect', () => {
|
|
||||||
sockets.delete(socket);
|
|
||||||
socketsEvents.emit('updated');
|
socketsEvents.emit('updated');
|
||||||
});
|
// https://socket.io/docs/v3/faq/index.html
|
||||||
});
|
const session = socket.request.session;
|
||||||
|
session.connections++;
|
||||||
|
session.save();
|
||||||
|
socket.on('disconnect', () => {
|
||||||
|
sockets.delete(socket);
|
||||||
|
socketsEvents.emit('updated');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
io.on('connection', handleConnection);
|
||||||
|
|
||||||
io.use(exports.socketSessionMiddleware(args));
|
io.use(exports.socketSessionMiddleware(args));
|
||||||
|
|
||||||
|
// Temporary workaround so all clients go through middleware and handle connection
|
||||||
|
io.of('/pluginfw/installer').use(exports.socketSessionMiddleware(args))
|
||||||
|
io.of('/settings').use(exports.socketSessionMiddleware(args))
|
||||||
|
|
||||||
io.use((socket:any, next:Function) => {
|
io.use((socket:any, next:Function) => {
|
||||||
socket.conn.on('packet', (packet:string) => {
|
socket.conn.on('packet', (packet:string) => {
|
||||||
// Tell express-session that the session is still active. The session store can use these
|
// Tell express-session that the session is still active. The session store can use these
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue