| Current Path : /var/www/html/wetty/src/client/ |
| Current File : /var/www/html/wetty/src/client/socket.ts |
import * as io from 'socket.io-client';
const userRegex = new RegExp('ssh/[^/]+$');
export const trim = (str: string): string => str.replace(/\/*$/, '');
const socketBase = trim(window.location.pathname).replace(userRegex, '');
export const socket = io(window.location.origin, {
path: `${trim(socketBase)}/socket.io`,
});