Skip to content

Error in Demo file server.js in WebSocket document #2870

@umakantv

Description

@umakantv

While going through the WebSocket document, I attempted to run the given server.js file in Node.js.
I established the connection and sent a message.
But there was an error message.match is not a function which caused the program to close.
I inspected the error, the message variable is a Buffer object.
I fixed it by converting that into a String.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions