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://somesource.com”);
socket.send(num);
socket.onmessage = function(data) {
alert(data);
};
And nothing…
By design somesource.com must return me some data responding on my "num"
Thanks!

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