Reading from Udp Port in Browser

Reading from udp port in browser

What you are looking for can't be done with in Javascript due to security constraints such as Distributed Denial of Service (DDOS) attacks. The closest technology available (that I know of) for client-side JS is WebRTC.

With WebRTC you can use DataChannels over SRTP and ICE as a possible solution.

See Also:

  • How to send a UDP Packet with Web RTC - Javascript?
  • Can I use WebRTC to open a UDP connection?

How to talk to UDP sockets with HTML5?

Yes, the answer is still 'no'. Websockets are TCP based. Note that a WebSocket is not a plain TCP connection, there is HTTP negotiation and a framing protocol in place. So you also cannot create a plain TCP connection in Javascript.

WebRTC is based on UDP, it may cover your use cases: http://www.html5rocks.com/en/tutorials/webrtc/datachannels/

Why can not I open a UDP connection on the client side (in browser)?

The browsers don't support it due to security constraints.

You should take a look at WebRTC

see also

  • How to send a UDP Packet with Web RTC - Javascript?
  • Can I use WebRTC to open a UDP connection?

How can we read/listen a UDP port in linux server and save the incoming data to MYSQL DB

to listen an UDP with php you can use sockets. There is a good example to start with. And about your second question, yes, you can use either cron launch of your script or php like a daemon.



Related Topics



Leave a reply



Submit