Fixed the javascript for real...now socket connections work fine