Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending messages from JavaScript #15

Open
davi4046 opened this issue Jun 29, 2024 · 1 comment
Open

Sending messages from JavaScript #15

davi4046 opened this issue Jun 29, 2024 · 1 comment

Comments

@davi4046
Copy link

davi4046 commented Jun 29, 2024

How are messages supposed to be formatted to be able to be send by JavaScript?

For example, this doesn't work:

const socket = new WebSocket('ws://localhost:8081');

const message = {
    kind: 'balls_of_steel:ChatMessage',
    data: {
        message: 'Hi Server!',
    },
};

socket.send(JSON.stringify(message))

Btw, I'm using the bevy_eventwork_mod_websockets crate. But I assume the message format is the same regardless.

@NoahShomette
Copy link
Collaborator

Responded more in depth in this issue on BEMW: NoahShomette/bevy_eventwork_mod_websockets#2 (comment).

I'll try and take a look and see if its reasonable to allow eventwork/network providers to use a different serialization method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants