3

Is it possible to send a SSDP M-SEARCH from javascript in a browser? The protocol is based on UDP, and the message I'd 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, more generically about sending UDP packets from a browser. The answer doesn't actually show any code samples however.

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

Community
  • 1
  • 1
Paul Fryer
  • 9,268
  • 14
  • 61
  • 93

1 Answers1

3

Sending SSDP M-SEARCH from browser is impossible.

Only UDP supported is not necessary for SSDP, because SSDP is multicast packet, so joining multicast group is also required.

As far as I know, only Chrome apps(with special permission) can do joining multicast group.

yjzhang
  • 4,859
  • 3
  • 19
  • 21