Added functions for interacting with websockets.