mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Fixed websocket connection.
This commit is contained in:
parent
6a7ff56038
commit
04cc3c8d54
1 changed files with 1 additions and 23 deletions
|
@ -72,29 +72,7 @@ exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Functio
|
|||
// e.g. XHR is disabled in IE by default, so in IE it should use jsonp-polling
|
||||
io = new Server(args.server, {
|
||||
transports: settings.socketTransportProtocols,
|
||||
}).listen(args.server, {
|
||||
/*
|
||||
* Do not set the "io" cookie.
|
||||
*
|
||||
* The "io" cookie is created by socket.io, and its purpose is to offer an
|
||||
* handle to perform load balancing with session stickiness when the library
|
||||
* falls back to long polling or below.
|
||||
*
|
||||
* In Etherpad's case, if an operator needs to load balance, he can use the
|
||||
* "express_sid" cookie, and thus "io" is of no use.
|
||||
*
|
||||
* Moreover, socket.io API does not offer a way of setting the "secure" flag
|
||||
* on it, and thus is a liability.
|
||||
*
|
||||
* Let's simply nuke "io".
|
||||
*
|
||||
* references:
|
||||
* https://socket.io/docs/using-multiple-nodes/#Sticky-load-balancing
|
||||
* https://github.com/socketio/socket.io/issues/2276#issuecomment-147184662 (not totally true, actually, see above)
|
||||
*/
|
||||
cookie: false,
|
||||
maxHttpBufferSize: settings.socketIo.maxHttpBufferSize,
|
||||
});
|
||||
})
|
||||
|
||||
function handleConnection() {
|
||||
return (socket: any) => {
|
||||
|
|
Loading…
Reference in a new issue