sockjs / sockjs-client

WebSocket emulation - Javascript client
MIT License
8.43k stars 1.3k forks source link

Sockjs Connection getting 401 error , info endpoint #625

Open MTsrfAjex opened 1 year ago

MTsrfAjex commented 1 year ago

Hi

I am using sockjs-client@1.6.1 with stompjs@2.3.3 in react application.

const socket = new SockJS(url); const stompClient = Stomp.over(socket); const httpHeaders = { 'Authorization': 'Bearer ' + authToken, }; stompClient.connect(httpHeaders, () => { //Success handler }, err => //error handler)

When i refresh the component , it's getting 401 unauthorized error in info endpoint I tried sevaral ways to pass token , but it's gettting same error , pls help me

Bhagwanta1997 commented 5 months ago

Could you please share your backend code?