Update ensure_connected
for websockets
#2486
Merged
ensure_connected
for websockets
#2486