Socket.io: Why is htmlfile preferred to XHR-Polling?

Based on socket.io 0.9.10 default config 1, htmlfile has higher priority over xhr-polling.

I had this idea that xhr-polling (aka long poolling) was a natural choice over websockets when it is not supported. If I keep htmlfile on list, it will be the selected transport for IE6, 7, 8 and 9.

My min req is IE7+, so should I remove htmlfile? I tested xhr-polling on IE7 and 9 and it works fine.

Why is that?

htmlfile streams the data, whereas XHR-Polling is request based, so it's possible for htmlfile to be more efficient. This site has a good explanation of each transport.

http://showmetheco.de/articles/2011/8/socket-io-for-backend-developers.html

Just FYI, I had problems using htmlfile with IE9 and web antivirus software (e.g. Avira Webguard). the sockets took around 30 seconds to reach the server.

Switching to XHR solved the problem, so I suggest you take that into consideration because many users have all kinds of internet protection software installed.