WebSocket connect error from server side

Hi,

I'm trying to create a websocket connection with purecloud. But i'm getting a connect error. Below is the error

'Expected a Sec-WebSocket-Protocol header.'

Screanshot is given below

image

nb: client credential method is used for getting access token.

Thanks and regards
Bharath

I'm not sure what technologies you're using or how you've written your code, but here's a tutorial on how to use websockets: https://developer.mypurecloud.com/api/tutorials/presence/?language=javascript&step=1

Hi Tim,

I'm using node js, and before i was able to create the websocket connection.
The code hasn't changed but this error I'm getting.

Please open a case with PureCloud Care to investigate.

Hi Tim,

I have already opened case with purecloud, but they advised me to visit the Developer Forum for the assistance.And they mentioned like they have limited knowledge with Developer concerns.
please help me to get out of this issue.

What's the case number?

#0002615077

From the information in the case, it sounds like you're trying to implement this and haven't ever gotten it to work. Can you provide some details about what you're doing?

I'm trying to get the real time queue data from purecloud. For that i used client credential method for getting access token.Then i created one Websocket connection.
Actually before i was able to create the websocket connection and i got the websocket heartbeat message, now same code is not working. After this websocket connection i want to listen the queue for real time data.
If you want to see the code i can share.

Yes, I'll need some details to be able to help you. Need to see some code and know what classes/libraries you're using for websockets. WebSockets work in node, so there's something unique about your application that's causing a problem.

Can i share the code here

I've never used the websocket package. The ws package has worked for me in the past though. It's used in this open source project: https://github.com/MyPureCloud/notification-relay/blob/master/src/socketManagerService.js

The websocket package may work, but you may need to configure it differently.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.