Prema
Prema

Reputation: 11

Is it possible to set the Origin header while creating the websocket connection

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"

Upvotes: 1

Views: 276

Answers (1)

Steffen Ullrich
Steffen Ullrich

Reputation: 123551

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.

Upvotes: 1

Related Questions