I am trying to create a python 3 program that sets up a websocket client and send some data to it.
I have learned that the data it sends isn't exactly in ASCII and if i try socket.send(b"Hello websocket!"), this will fail for me. I have used the create your own test example on http://www.websocket.org/echo.html and when I wiresharked the data that it sends to the websocket, it wireshark doesn't display the sent data in readable characters (I'm assuming its been translated by some algorithm). Also, when I view the data it sent in c array's, it's different values every time I run it. I can't figure out how it translates the "WebSocket rocks" text into something that will work. How would I be able to accomplish translating the message being sent in python? I guess the true question is that what is the formula javascript uses for send() to take the parameters from a string into the data necessary that I can port to python so that it does the same thing.