'JavaScript WebSockets with UDP?

I'm writing a JavaScript Application that has to receive a huge amount of data from other users. It is not important if some of this data gets lost. Is there some way of using JavaScript WebSockets with UDP instead of TCP?



Solution 1:[1]

It sounds like what you're waiting for is WebRTC which is working it's way through the standards process. WebSockets, as other people have pointed out, run over TCP as a result of initiating with an HTTP Upgrade.

Solution 2:[2]

Sounds like the question is meant for client-side UDP, but since I ended up here...

You can do UDP in JavaScript on the server using the node.js dgram package.

Solution 3:[3]

The WebSockets protocol is over TCP only as currently defined.

You could do UDP with Flash if you are willing to use a RTMFP (Real Time Messaging Flow Protocol) server.

Solution 4:[4]

If this question is still pending: I found a project called JNEXT and there is an example using UDP. The project itself seems to be paused but at least in Firefox it works (it doesn't work with Chrome and Opera). May be it is worth to look for it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chad
Solution 2 Nick Benes
Solution 3 Community
Solution 4 Klaus