may i know to use websocket , need to write server code? in other words, javascript in my client application will need to connect to extra server rather than just my existing Apache server?
You can download a solution from http://www.kaazing.com/download that let you start using Websockets today. There is also plenty of documentation to get you going here - http://tech.kaazing.com
The pywebsocket project adds experimental WebSocket support to Apache httpd.
It seems like an activly maintained project, and is even being used by the WebKit crew to test WebSocket support in their browser code.
Here is another web socket server based on node.js: websocket-server-node.js
http://jwebsocket.googlecode.com is another one that lets you write WebSocket based server applications in java.
For a WebSocket server written in PHP you should try WaterSpout server
Yes, there is a php implementation on google code: project phpwebsocket
... and i have done a rewrite for more structured code: