Sending header on websocket in java script

#1

Hi Tobias,
I want to send authentication header on websocket connection with request.
In autobahn python this is possible using api llike this WebSocketClientFactory(sys.argv[1],headers = headers, debug = debug,debugCodePaths = debug).
where we define header as headers = {‘Authorization’: ‘Basic cmljazpyaWNrMTIz’}.

But I couldn’t find any api in autobahn java script library which can support this functionality.

Could you please have a look at this?

0 Likes

#2

It is not possible in JavaScript, since the WebSocket API (in browser JS) does not allow to provide custom headers ..

/Tobias

···

Am 09.07.2013 11:43, schrieb Shyam Biradar:

Hi Tobias,

      I want to send authentication header on websocket connection with
request.
In autobahn python this is possible using api llike this
WebSocketClientFactory(sys.argv[1],*headers = headers*, debug =
debug,debugCodePaths = debug).
where we define header as headers = {'Authorization': 'Basic
cmljazpyaWNrMTIz'}.

But I couldn't find any api in autobahn java script library which can
support this functionality.

0 Likes