There's some potentially useful snippets for creating a websocket client in this thread - make sure you scroll all the way through