Which is faster: websocket or "normal" connection?

Good day, comrades!

Downloadable we to the server files via xhr. Now we just read the file (whether or FileReader FormData) and ship to the server via XMLHttpRequest.
However, the whole site is built on websocket. Maybe it would be wiser to send via sockets? Or too long/pitfalls/etc?
July 9th 19 at 10:13
3 answers
July 9th 19 at 10:15
Solution
I think the only problem will be work with the other Protocol messages until you transmit the file. Have not worked with websockets, but something tells me that the transfer of the file will block other messages on the channel. If this is critical, you have two solution:
1. The file transfer parts.
2. To transfer a file on another channel. Such a channel may be a separate socket or attention, xhr

If my assumption about the blocked channel is erroneous, what other pitfalls I can't.

Remember that in the http Protocol for you already took care of the transfer format files (remember about multipart/form-data, as one of the solutions) in the sockets you will be creating the bike.
July 9th 19 at 10:17
However, the whole site is built on websocket. Maybe it would be wiser to send via sockets? Or too long/pitfalls/etc?

It will be wiser to use web sockets. The basic meaning of websockets - continuous operation in both directions.
Pitfalls - support web sockets web browsers.

Study socket.io module and better binaryjs to stream the file.
July 9th 19 at 10:19
"Normal" connection is HTTP, it is also based on TCP/IP, but to obtain a response from the server is required to first make an HTTP request, it is a burden on the client and on the server, and WebSockets is almost "raw" TCP/IP connection remains open, there is no "requests" and "responses", both sides send packets when they "want", so WebSockets is a better fit for push notifications, such as instant messaging (chat), in other cases makes no sense.
if they have the whole website in web sockets... - abigail36 commented on July 9th 19 at 10:22

Find more questions by tags JavaScriptNode.js