Since i found that its not possible to override main WebSocket object, and since there is no way to establish simple tcp connection with html5. Another solution would be using java applet to form the tcp connection and modify its header to form a websocket client with static headers. I think this one would be possible
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Since i found that its not possible to override main WebSocket object, and since there is no way to establish simple tcp connection with html5. Another solution would be using java applet to form the tcp connection and modify its header to form a websocket client with static headers. I think this one would be possible