metube/ui/src/app/metube-socket.ts
2025-12-05 11:36:21 +02:00

12 lines
380 B
TypeScript

import { Injectable } from '@angular/core';
import { ApplicationRef } from '@angular/core';
import { Socket } from 'ngx-socket-io';
@Injectable()
export class MeTubeSocket extends Socket {
constructor(appRef: ApplicationRef) {
const path =
document.location.pathname.replace(/share-target/, '') + 'socket.io';
super({ url: '', options: { path } }, appRef);
}
}