Ionic 2 socket chat b/w server mobile device to client mobile


i’m working on a chat app to communicate b/w mobile devices using and latest ionic/cordova. app also contain media transfer and other simple functionality. among of them one device is as a root which works as server and serve some static content to other. or may need to server web service for other. i found a scoket but i it was unable to wrap this with ionic 2. also i am not getting how to implement chat with this. can anyone guide me