mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-26 02:16:16 -04:00
Added node workspace.
This commit is contained in:
parent
95d99424e1
commit
65046a3ff2
11 changed files with 29 additions and 27 deletions
|
@ -22,14 +22,15 @@ const connect = (etherpadBaseUrl, namespace = '/', options = {}) => {
|
|||
|
||||
let socketOptions = {
|
||||
path: socketioUrl.pathname,
|
||||
upgrade: true,
|
||||
transports: ["websocket"]
|
||||
}
|
||||
upgrade: true,
|
||||
transports: ['websocket'],
|
||||
};
|
||||
socketOptions = Object.assign(options, socketOptions);
|
||||
|
||||
|
||||
const socket = io(namespaceUrl.href, socketOptions);
|
||||
|
||||
socket.on('connect_error', (error) => {
|
||||
console.log('Error connecting to pad', error);
|
||||
if (socket.io.engine.transports.indexOf('polling') === -1) {
|
||||
console.warn('WebSocket connection failed. Falling back to long-polling.');
|
||||
socket.io.opts.transports = ['polling'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue