Added node workspace.

This commit is contained in:
SamTV12345 2024-03-15 20:59:28 +01:00
parent 95d99424e1
commit 65046a3ff2
11 changed files with 29 additions and 27 deletions

View file

@ -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'];