HTML5 Client: What is the difference between Websockets and XHR?
Websockets is the persistent connection that can be used to receive/send data without sequential order and without http header.
Xhr-polling creates a new request with http header and waits for an answer with http header, also a sequential order.
It means that XHR data flow always looks like this:
HTTP_HEADER_REQUEST -> HTTP_HEADER_ANSWER
HTTP_HEADER_REQUEST -> HTTP_HEADER_ANSWER
and so on
Also before the data can be downloaded, the header must be requested with HTTP_HEADER, therefore its name: XHR-polling.
Websockets data flow may look like this:
FRAME_DATA_SEND
FRAME_DATA_SEND
FRAME_DATA_RECEIVE
FRAME_DATA_SEND
FRAME_DATA_RECEIVE
FRAME_DATA_RECEIVE
Also there are random data of sending/receiving without special sequential order and without any http header data.
That makes the usage of reverse proxies impossible due to the lack of Websockets supported by most known reverse proxies; but half of the xhr transport may work with Apache reverse proxy.
Also see: HTML5 Client: Supported Browsers