websocket basic authentication in cordova vs. Chrome

I have a Cordova app and when I use websocket to do basic authentication in Chrome it works:

var ws = new WebSocket('ws://user:password@192.168.1.10');

When I run in Android emulator, I always get a 401 error.

Unexpected response code: 401

If I disable authentication in server side, then both Android emulator and Chrome work, so my guess is that something in Cordova is making it impossible for authentication to work. Any clues on what might be wrong?