fix treatment of localStorage, make io.socket work on insecure connections