Skip to content

Where is the message? #24141

@JoyceBabu

Description

@JoyceBabu

Existing documentation URL(s)

https://developers.cloudflare.com/durable-objects/examples/websocket-server/

What changes are you suggesting?

The comment says the server responds with the same message. I don't see the original message in the send call.

Is it a mistake or is the message added automatically?

// Upon receiving a message from the client, the server replies with the same message,
// and the total number of connections with the "[Durable Object]: " prefix
server.addEventListener("message", (event) => {
server.send(
`[Durable Object] currentlyConnectedWebSockets: ${this.currentlyConnectedWebSockets}`,
);
});

Additional information

No response

Metadata

Metadata

Labels

content:editRequest for content editsdocumentationDocumentation editsproduct:durable-objectsDurable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions