mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Added basic app.
This commit is contained in:
parent
b3741470ed
commit
3e18f65d3b
17 changed files with 581 additions and 382 deletions
|
@ -8,6 +8,8 @@ import log4js from 'log4js';
|
|||
const proxyaddr = require('proxy-addr');
|
||||
const settings = require('../../utils/Settings');
|
||||
import {Server, Socket} from 'socket.io'
|
||||
import path from "path";
|
||||
import {readFileSync} from "fs";
|
||||
const socketIORouter = require('../../handler/SocketIORouter');
|
||||
const hooks = require('../../../static/js/pluginfw/hooks');
|
||||
const padMessageHandler = require('../../handler/PadMessageHandler');
|
||||
|
@ -76,6 +78,12 @@ export const expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Fu
|
|||
maxHttpBufferSize: settings.socketIo.maxHttpBufferSize,
|
||||
})
|
||||
|
||||
args.app.get('/socket.io/socket.io.js', (_req,res:any) => {
|
||||
res.header('Content-Type', 'application/javascript; charset=utf-8');
|
||||
const socketIo = readFileSync(path.join(settings.root, 'src', 'node_modules', 'socket.io-client', 'dist', 'socket.io.min.js'), 'utf8');
|
||||
res.header('Cache-Control', `public, max-age=${settings.maxAge}`);
|
||||
res.send(socketIo);
|
||||
})
|
||||
|
||||
const handleConnection = (socket:Socket) => {
|
||||
sockets.add(socket);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue