r/webdev•
6_star_man

Is there an easy way to send custom websocket messages over an already established connection?

Question

How come on the devtools there is no ability to edit and send custom messages when viewing sent and received messages?

Posted Feb 12, 2022, 10:10 AM UTC

9688
BehindTheMath•

I don't know of any such capability for HTTP requests either.

1
6_star_manOP•

Then you don't know anything

-2
BehindTheMath•

Can you enlighten me?

1
BkoChan•

Howcome? Because the devs haven't built in the feature

If you need to though dev tools > memory > take snapshot

Filter the snapshot by searching for "websocket", right click the socket in the results and store as global variable

You can then access the socket in the console using the variable temp1

$ temp1.send('foobar')

1
SagePhoenix12222•

This is the way.

1
Dkrey93•

Done

1
[deleted]•

[removed]

1
AnnaMolePH•

Voted!

1