Using WebSocket in Ionic

Hi, everyone!
Please, help… what should I do in order to use websocket in my ionic app?
I couldn’t find any info in docs about this.
I’m just writing in my code:
var num = "1"
var socket = new WebSocket(“ws://”);
socket.onmessage = function(data) {
And nothing…
By design must return me some data responding on my "num"

I’m looking for a websocket approach for ionic v2 as well. Any answers?