gekkepop.
gekkepop.
CDCloudflare Developers
Created by gekkepop. on 7/21/2024 in #workers-help
How to modify websocket request before sending it to durable object
Thank you very much, really appreciate it!
3 replies
CDCloudflare Developers
Created by gekkepop. on 7/21/2024 in #workers-help
How to modify websocket request before sending it to durable object
It works!
3 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
Thanks a lot for the help, really helped me out here!
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
I think I finally get it
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
O, and then I can use getTags to see which websocket is currently sending
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
InacceptWebSocket?
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
How do I know incoming messager from a websocket is for example "A" or "B" or "C"
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
But how do I give them a tag?
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
I need some way to get the correct websocket for C based on the input of A, so I need some kind of pointer
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
But how would I send a message to a specific websocket? So let's say my durable object has a connection with a,b,c, and I want to send a message from a -> c, how can I do that?
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
(well similar), but for me it doesn't work
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
I want to do something like this: async fetch(request) { const webSocketPair = new WebSocketPair(); const [client, server] = Object.values(webSocketPair); this.sessions.set(client, crypto.randomUUID()); }
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
I only have the websocket itself
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
Yeah, but the problem is how do I relate a WebSocket to this unique tag
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
Or do I just use the websocket itself as a id? So I can do ws === ws?
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
Do you happen to know if the websockets have an id or a name I can use to reference them and make disctions between the websockets themselves? I don't see anything in the api
29 replies
CDCloudflare Developers
Created by gekkepop. on 6/16/2024 in #workers-help
this.ctx.getWebSockets() return array of empty objects
You were correct! If I just assume it contains a websocket, it actually has one
29 replies