问题标签 [ssdp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
10437 浏览

iphone - iPhone 上的 SSDP

我需要能够发送一条 UDP 消息并接收一条消息,以便从 iPhone 发现网络上的 SSDP 设备。

我知道我需要将数据包发送到多播地址,并且我的 HTTP 请求需要看起来像这样:

从阅读文档看来,我可以使用 CFNetwork 完成所有这些工作,尽管阅读(并重新阅读文档)我仍然难以开始。任何人都可以推荐教程或代码片段来帮助我度过最初的学习障碍吗?

我有 CFNetwork 编程指南:

http://developer.apple.com/mac/library/documentation/Networking/Conceptual/CFNetwork/CFNetwork.pdf

和 Beej 的使用 Internet 套接字的网络编程指南:

http://beej.us/guide/bgnet/

谢谢

戴夫

附言

在这种情况下,我无法使用任何第 3 方库和框架。

0 投票
1 回答
3017 浏览

linux - SSDP 和接口 IP 地址

我正在编写一个需要发送和接收SSDP消息的UPnP AV / DLNA DMS 。为了响应某些数据包,我需要发送带有资源(在本例中为 HTTP 服务器)的 URL 的回复,我已选择绑定到( )。当然,这个地址对数据包的发送者来说是没有意义的:接收数据包的接口地址是最合适的。M-SEARCHINADDR_ANY0.0.0.0M-SEARCHM-SEARCH

如何确定在回复数据包中发送的适当地址?

我考虑过的一些想法是:

  1. 将不同的接收器绑定到每个套接字。当接收者收到一个M-SEARCH数据包时,回复地址可以在回复中使用套接字的本地地址。然而,这需要了解和迭代所有接口,并随着接口可用性的变化添加和删除接收器。
  2. 将单个接收器放在 上INADDR_ANY,并迭代接口网络掩码以确定可能的来源。但是,多个接口可能共享同一个子网。
  3. 收到数据包后提取 IP 目标地址。这将是特定于 IP 的,并且可能会在网络抽象的某个地方丢失。
0 投票
2 回答
3094 浏览

upnp - 使用 SSDP 搜索 UPnP 设备

我想在网络上搜索我的媒体播放器。我认为它是使用 SSDP m-search 完成的吗?

另外,当我打开设备时,它会广播它的可用性吗?如何收听该广播,以及如何发送 m-search 查询?

0 投票
1 回答
3690 浏览

python - 使用 tcpdump 跳过 IP 标头

tcpdump用来调试 SSDP 服务。

在打印 UDP 数据包时,在我认为是 IP 和 UDP 标头的 HTTP 标头之前,我遇到了很多乱码。如何禁止打印这些,只打印数据包中的应用程序级数据(包括 HTTP 标头)?

这是一个例子,我不想要的东西NOTIFY在第二行之前:

0 投票
3 回答
4142 浏览

delphi - 我可以使用 IdUDPClient 发送 M-SEARCH 请求吗?

我的网络中很少有 uPNP 设备。我正在尝试向网络发送 M-SEARCH 请求并希望收到一些响应。这就是我正在尝试的:

我没有收到来自 UDP 客户端的任何信息。我使用 Wireshark 来监控网络流量,并且没有从我的主机发送消息。

有任何想法吗?谢谢你。

我终于找到了答案:

0 投票
3 回答
13640 浏览

c# - UPnP Multicast: missing answers from M-SEARCH (Discovery)

I created a small program to test UPnP Multicast (Visual C# 2010 Express, running on Windows 7 Professional 64 Bit). I can receive the UPnP NOTIFY Messages from UPnP Devices in my Network. But when i send the M-SEARCH Message, i get no Answers.

I have tested the same code on a iOS environment (Monotouch for iOS, running on a iPhone simulator on a Mac). There it runs fine and i get all the search responses from my UPnP devices. I can also see the M-SEARCH message from my windows program.

It looks like Windows (or a Firewall?) is hiding the search responses. Any idea?

Here is the code:

0 投票
2 回答
18505 浏览

ssdp - SSDP 协议 - 实现

我正在尝试实现 SSDP 协议,但我不确定它是如何工作的。SSDP 通过 udp 发送数据,这很清楚。如果控制器连接到网络,它可以搜索带有 MSEARCH 消息的设备,该消息可以发送到多播地址 239.255.255.250:1900。每个设备都必须监听这个地址并做出响应。但我不知道他们是如何回应的。我在wireshark中看到他们用单播响应,但我不知道如何确定接收响应的端口。

编辑 - - - - - - - -

我正在尝试使用尖峰模糊测试框架编写 ssdp 模糊测试。正如我所说,我能够发送正确的数据,但无法接收响应。我将尝试粘贴一些带有简要说明的尖峰代码。有 Spike 结构,它表示要发送的数据(它存储实际数据、大小、协议信息......)。我删除了一些变量以使其更清晰。

现在我正在通过 udp 发送数据,并希望通过以下功能接收一些响应

功能实现:

这工作正常并通过 udp 发送数据。现在我想通过打开的套接字 current_spike->fd 接收一些响应。函数 s_read_packet 无效

但是函数 s_read_packet 不会产生任何数据...

0 投票
1 回答
4952 浏览

objective-c - Best way to parse SSDP Discovery in Objective C

I am working on a very simple application to discover a device using SSDP and I am trying to find the easiest way to parse the response from this command. I am trying to avoid having to do a bunch of NSString or regular expressions manipulations.

I have tried the following two approaches:

Approach 1: Using GCDAsyncUdpSocket, I am able to successfully send the discovery command and get the following response:


HTTP/1.1 200 OK
Cache-Control: max-age=300
ST: roku:ecp
USN: uuid:roku:ecp:1234567890
Ext:
Server: Roku UPnP/1.0 MiniUPnPd/1.4
Location: http://192.168.XX.XX:8060/


This looks like a regular HTTP response, but using GCDAsyncUdpSocket, I am getting the response as an NSData object, which I can easily convert to an NSString. However, what would be ideal is to somehow cast this to an NSHTTPURLResponse and then use its methods to get the field values. Any idea if this can be done?

Approach 2: I have tried using a regular NSURLRequest to try to send this command and then I would be able to get an NSHTTPURLResponse back. However, I keep on getting an error because the SSDP discovery command requires me to send this request to port 1900. I use the following code to send the "HTTP" request, I know it is not strictly HTTP, but I thought it may be an easier way to send this UDP command as the requirements look very similar to HTTP.

When I do this, the connection is successful, but I get the following error in the didFailWithError delegate for NSURLConnection:

failed Error Domain=NSPOSIXErrorDomain Code=47 "The operation couldn’t be completed. Address family not supported by protocol family" UserInfo=0x8875940 {NSErrorFailingURLKey=http://239.255.255.250:1900/, NSErrorFailingURLStringKey=http://239.255.255.250:1900/}

This error only happens if I use port 1900, if I leave this out or use another more HTTP friendly port such as 8080, then this works, but obviously the device I am trying to discover does not respond correctly unless it gets the request in port 1900.

Thanks for any help you can provide.

0 投票
1 回答
7975 浏览

upnp - 将网络视频流式传输到 Roku

有谁知道如何从技术上将视频(即 Youtube 视频)发送到 Roku 播放器?有一个“Twonky Beam”应用程序允许流式传输,它似乎做的是将 .mp4 文件发送到 Roku 进行播放。在此处查看演示:http: //gigaom.com/video/youtube-on-roku-twonky-airplay/

这是在没有“Twonky Beam”Roku 应用程序的情况下完成的。看起来像 Roku 原生支持的东西,虽然我找不到任何文档。

我想知道他们是如何在没有 Roku 成为 UPNP 或 DLNA 设备的情况下做到这一点的。

这里的任何见解都会很棒!

0 投票
3 回答
1510 浏览

c# - Windows 8 Metro 中的 SSDP 发现不可靠

我在 Windows 8 Metro 程序中实现 SSDP 发现时遇到问题。下面是代码:

这段代码根本不可靠。大约 50% 的时间它找不到连接的设备,而其他发现可以找到。但有时它会起作用。

我的网络嗅探器 (SmartSniff) 有时甚至无法捕获其 SSDP 请求,即使我已经多次拨打电话。

我不认为这是一个异步问题,因为它偶尔会起作用。请帮我 !谢谢!