I have gone through some websites and found that it is not posssible to add headers while usig web socket.Is that true
I have to pass the origin header as Origin : "http://localhost:4200"
The Origin header is not in control of the Javascript running on a page. It is set by the browser, without control of the web application running in the browser. This is not only the case for Websockets but for any HTTP requests from the browser.