VerifiedUser - X
CDCloudflare Developers
•Created by VerifiedUser - X on 11/28/2023 in #workers-help
Cloudflare Worker Websocket
This is websocket code that handle a "Controller" and "MCU". ( Assume that controller and device are two different devices that makes two different connections with cf worker websocket) when client send register1 or register2 worker register connection as Controller and MCU respectively. When normal message sent by MCU or Controller in format "message-<message here>" it checks who sent it and forward it to opposite one. But there is problem in code. the registration works well. But normal messaging not delivered to both devices ( MCU and Controller and vise versa). Can anyone help me to figure the problem out.
Here is my code : https://pastebin.com/raw/h17weWxa
3 replies