WebSocket connection failed. Error during WebSocket handshake.Unexpected response code: 403 - websocket

https://github.com/aws/aws-iot-device-sdk-js/blob/master/examples/browser/mqtt-explorer/index.js
I'm using the example code from github to connect to my aws iot core.
upon running the code i get the following error
WebSocket connection to "websocket url" failed: Error during WebSocket handshake: Unexpected response code: 403
i'm using cognito unauthenticated role with full access AWS IOT policy.
what could be the issue here?

Related

WebSocket API gateway connection issue

We are working on the ASP.Net core API application. In this application, we have a SignalR module for notification. We planned to host the application in the AWS environment. We have used the AWS lambda service to host the API, and also the WebSocket API gateway to consume the notification/SignalR part.
We are facing an issue with connecting the notification URL.
When we tried to connect the Web socket URL from Commandline using Node, it is showing "Unexpected server response 403".
When we tried to consume the URL from the frontend application, it showed the below error.
"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled. ."
We are stuck with this issue. Any help to resolve this issue would be appreciable.

Can't establicsh WebSocket connection. Error in connection establishment: net::ERR_CERT_COMMON_NAME_INVALID

I was trying to connect live streaming in my laravel application using Antmedia Streaming Server, when it comes to production the websocket is not connected. I think the browser is blocking the server url. Can anyone help ?

Websocket Connection Failure when connecting to bot with DLS client

When connecting to a local instance of the bot through a proxy and ngrok, I am able to receive responses using DLS client. However, when testing with the app service I receive no responses back and the following error:
"Error ConnectionFailure : Connection was closed by the remote host. Error code: 1000. Error details: Exceeded maximum websocket connection idle duration(> 300000ms) SessionId: 2ee9810a2916418a93dc1e978c49566b"
I have tried to restart the app service, ensured I have checked the "Enable Streaming Endpoint" box and toggled "Web sockets" to On, and even tried creating the app service. Looking at the app service logs, The GET request to the appservice returns 404, the bot receives a request and invokes StartWebSocketAsync but gets a 400 error and completed the request with http 400. There are no other exceptions being thrown, and locally everything seems to be working fine.
Any pointers would be appreciated.
Thank you!

Reg: Socket Connection in Ionic3

I am having an issue with the socket connection with my ionic3 application. I am using socket for implementing chat. Please find the below work flow.
I have configured the socket.io in my dashboard moudule (Not on app.module.ts) because I have to pass user token while connection which is obtained only after login. I have added screenshot below. Here I am getting success socket connection with the server.
When I import the socket in my chat page, I am getting the below error.
Is there any mistake in my approach? If my question is not clear to you please comment below before downvoting.

when using Jmeter to test websocket stomp, cannot send connect message correctly

I installed websocket stomp sampler plugin to Jmeter, and new a stomp sampler to test the server. but when I filled the connect message as the message
I got from the developer:
CONNECT
accept-version:1.1,1.0
heart-beat:10000,10000
host: qa.so.aws.mxj.mx
^#
The Jmeter gave 400 error and said
"- Connect or Subscribe Paylod Message are empty"
When I saw the request from Jmeter, it said:
["CONNECT\n\n\u0000"]
I don't know how to let Jmeter to get the correct connect message, please help me with this problem.
Try by giving both Connect Message and subscribe message.
Example:
Connect Message
CONNECT\naccept-version:1.1\nheart-beat:0,0
Subscribe Message
SUBSCRIBE\nid:sub-0\ndestination:/topic/queue
Select both the check boxes Streaming connection and stomp protocol along with other details (host, port, protocol, path, connection and response timeout).

Resources