Safari on iPhone OS 4.0 (build 8A230m) supports WebSocket. Here’s the output from the WebSocket test:
Yes, the browser still reports OS 3_1_2 even though the OS is really 4.0. The AppleWebKit version is newer than the iPad.
I was able to run a WebSocket test against Kaazing’s WebSocket Gateway.