You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think you may be missing something with your AWS Lambda code. Generally, disconnect happens in a separate handler, but I'm not sure what exactly you're doing.
In any event, on the client-side, what Sockette does is exactly the same as the following code:
functionsocketHandler(uid){consturl=`wss://MY_API_GATEWAY_URL.execute-api.ap-northeast-2.amazonaws.com/dev?groupId=GROUP_ID&uid=${uid}`;returnnewWebSocket(url);}constwss=socketHandler('123');setTimeout(()=>{// some time later...wss.close(1000);},3000);
Sockette doesn't add/change anything in this process; see here
If the above still fails for you, either your Lambda code needs adjusting or the browser API doesn't do what you're expecting – which, IMO, still means that your Lambda needs adjusting.
I built up the WebSocket server with
AWS API Gateway
.and, I am connecting this with
AWS Lambda
.It works well when I connect, but when I disconnect, it doesn't work well.
My React Client Code
My Lambda Code
I'd like to use WebSocket URL with
queryParameters
even I disconnect.If I missed something, please reply me.
The text was updated successfully, but these errors were encountered: