How to send M-SEARCH from Javascript / Browser

Is it possible to send SSDP M-SEARCH from javascript in browser? The protocol is based on UDP and the message I would like to send from Javascript should look like this:

M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: seconds to delay response
ST: search target
USER-AGENT: OS/version UPnP/1.1 product/version

      

Someone asked a similar question , a more general way to send UDP packets from the browser. The answer doesn't really show any code samples.

I understand WebRTC allows things like DataChannels , but that's not what I'm looking for. I am literally looking for a way to send UDP packets from javascript running in the browser like the example above.

+3


source to share


1 answer


SSDP sending M-SEARCH

from browser is not possible.

SSDP does not require UDP-only support because SSDP is a multicast packet, therefore multicast group aggregation is required.



As far as I know, only Chrome apps (with special permission) can connect to a multicast group.

+3


source







All Articles