javascript - Are there any reasons to mix WebSockets and XHR? -


i developing spa - of features require real time bidirectional communication , not.

are there reasons mixing xhr , websockets here?

i suspect since need use websockets anyway, using websockets makes sense, i'm wondering if there considerations haven't taken account.

it depends on outcome of xhr request compared websocket connection? websockets faster not creating http header , allow larger amount of data transferred.

from experience work incredibly hard on making requests / transactions in application same - applying dry principles can make , else has work on project lives lot easier.


Comments