Your IP : 216.73.216.40


Current Path : /var/www/html/wetty/src/client/
Upload File :
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`,
});