JavaScript WebSockets with UDP?

JavascriptTcpUdpWebsocketPacket

Javascript Problem Overview


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?

Javascript Solutions


Solution 1 - Javascript

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 - Javascript

No, it's not possible to have UDP communication within JavaScript. Sorry.

Solution 3 - Javascript

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 4 - Javascript

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 5 - Javascript

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.

Solution 6 - Javascript

I think you can leverage Silverliht 4 technology. You can create a Silverlight 4 application to communicate with server and then enbamdded it to html page. Then your JavaScript can build TCP connections via Silverlight 4 application!

Solution 7 - Javascript

You could write a WebSocket server to serve as proxy/bridge between TCP/UDP.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser142019View Question on Stackoverflow
Solution 1 - JavascriptChadView Answer on Stackoverflow
Solution 2 - JavascriptPablo Santa CruzView Answer on Stackoverflow
Solution 3 - JavascriptNick BenesView Answer on Stackoverflow
Solution 4 - JavascriptkanakaView Answer on Stackoverflow
Solution 5 - JavascriptKlausView Answer on Stackoverflow
Solution 6 - JavascriptJohnView Answer on Stackoverflow
Solution 7 - JavascriptTim R.View Answer on Stackoverflow