Failed to connect to localhost port 8080: Connection refused code example
Example: cordova websocket connection refused localhost 8080
/*This worked for me after searching the internet for a long time*/
You need to use ws://yourIp:9090/, where yourIP is like 192.168.?.?.