0

My task is to get a video stream from UDP (it's set on localhost:4000) and play this stream at a webpage player. I'm not sure I can connect my webpage with incoming UDP traffic. I tried to set flask server to receive UDP but unsuccessfully.

Also, I tried this one https://github.com/simagix/udp_streaming, I've set a server and send UDP traffic to it, but received an error: UDP access out a warning: send error: Connection refused

Is it even possible to receive UDP at a web player or its only about TCP?

Pete Ythong
  • 305
  • 5
  • 13
koffein
  • 13
  • 4

1 Answers1

0

as far as I know, browsers don't allow a webpage's javascript to use sockets directly. this would be a major security issue, so they only expose much higher level protocols. traditionally this was only HTTP(S) via XMLHttpRequest and the related WebSocket protocol that allows bidirectional communication, but is still a stream based/reliable transport.

WebRTC might be closer to what you're after, but is still much higher level than "UDP" and includes related but often necessary tools for doing things like punching holes in firewalls. if that sounds about right, then check out: https://stackoverflow.com/a/53948107/1358308

Sam Mason
  • 15,216
  • 1
  • 41
  • 60