I'm using websocket in my Angular app using rxjs.
I'm instanciating it like this : i want to add some headers :
myheader : "abcde"
how my i do it ?
here is my code:
import { BehaviorSubject, of, Subscription, Subject, Observable, NextObserver } from 'rxjs';
@Injectable()
export class WebsocketService {
openConnection() {
this.close();
const url = 'wss://echo.websocket.org';
this.connection$ = webSocket({
url,
openObserver: this.openObserver,
closeObserver: this.closeObserver,
});
this.getmsg();
}
}
Suggestions ?