I’m not sure if the group chat servers have WebSocket up and running yet, but for IRC it’s pretty simple (though don’t get to comfortable either way, because Twitch doesn’t plan on keeping the whisper system on the group chat servers forever).
That being said, you can send and receive whispers by connecting to the group chat servers (send and receive are both on them).
To send:
PRIVMSG #jtv :/w otherusername message
(where otherusername is their username, and message is your message to send)
or just message:
otherusername message to #jtv
To receive, RAW send the two necessary CAP requests on (or after) login:
CAP REQ :twitch.tv/tags twitch.tv/commands
and then look for messages in the format:
:yourusername!yourusername@yourusername.tmi.twitch.tv WHISPER otherusername :message
(where otherusername is their username, message is their message, and yourusername is your username)