websockets / wscat

WebSocket cat
MIT License
2.25k stars 223 forks source link

Not seeing response data #142

Open paul-uz opened 2 years ago

paul-uz commented 2 years ago

For example, on my $connect handler, I return

{ statusCode: 200, body: 'Connected' }

But when I connect via wscat, I'm not seeing the body text in the terminal.

lpinca commented 1 year ago

What you mean with "$connect handler"? To get that data, the WebSocket server that wscat connects to should send a message like this

websocket.send(JSON.stringify({ statusCode: 200, body: 'Connected' }));
razvanphp commented 10 months ago

I wanted to add an issue for not showing the error messages in the body, for example in this case:

error: Unexpected server response: 500
>

when using curl, I get the real error in the body like:

{"message":"Unable to find ....

Maybe I can prepare a PR, if the project is still maintained...