1889 - Send Init Message prior to OnConnected (JS and Server)

This is the fix for JS and Server for #1889