SvenKirschbaum / react-stomp-hooks

This repository contain a react library which enables simple access to stomp subscriptions via hooks.
MIT License
59 stars 12 forks source link

Handshake have no connectHeaders #30

Closed akiselevych closed 4 months ago

akiselevych commented 4 months ago

Hello ! I pass Authorization header into connectHeaders but handshake request not containing it.

This how my code looks like" image

console log of THIS

1

But handshake request not containing it image

SvenKirschbaum commented 4 months ago

Hello!

The headers you set with these options aren't HTTP headers, but STOMP headers. You should see them show up in the CONNECT frame sent as the first message over the websocket connection (or other transport).

As far as i know, it is not possible to set HTTP-Headers on the Requests used to establish a websocket connection, as a limitation of the browser APIs. I don't think stompjs exposes an option to set headers on the info endpoint requests either.

akiselevych commented 4 months ago

Understand, thank you !