- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将本地 mosquitto(在树莓派上)桥接到某个云代理,以便我可以发送数据并使用该数据控制某些设备。我尝试使用 Cloudmqtt 和 dioty,但没有成功。在 cloudmqtt 的情况下,我被告知 mosquitto.conf 文件一切正常,对于 dioty,我被告知它使用不支持桥接的 Mosca 代理(我被告知我指的是 cloudmqtt 和 dioty支持服务)。有谁知道可以桥接到本地 mosquitto 的远程代理,有人已经尝试过吗?
我考虑过使用一些物联网平台来做到这一点,但我已经读过该平台使用定价,我这样做是出于学习和业余爱好的目的,所以在我学习如何使用它之前,我想继续免费帐户。
编辑:我正在使用 mosquitto 1.4.5,mosquitto.conf 文件如下:
#Place your local configuration in /etc/mosquitto/conf.d/
#
#A full description of the configuration file is at
#/usr/share/doc/mosquitto/examples/mosquitto.conf.example
connection cloudmqtt
address mnumber.cloudmqtt.com:port
topic zaESP8266 in 0
topic ESP8266 out 0
try_private true
notifications false
start_type automatic
remote_usename username_of_the_user_on_cloudmqtt
remote_password password_of the_user_on_cloudmqtt
pid_file /var/run/mosquitto.pid
persistance true
persistance_location /var/lib/mosquitto/
我选择 Cloudmqtt 作为在线 mosquitto 代理的原因是因为我认为本地 mosquitto <--> 远程 mosquitto 桥应该可以工作。而且我可以使用笔记本电脑或手机等客户端,并使用它们向本地代理发布和订阅消息。这样即使我无法访问互联网,我也可以让本地经纪人与本地客户互动。
编辑:我配置了 mosquitto.conf 文件,以便我可以与 test.mosquitto.org 桥接,我添加了这些行:
connection test
address test.mosquitto.org
topic in_topic in 0
topic out_topic out 0
try_private false
notifications false
bridge_attempt_unsubscribe true
现在,我可以在一个终端中使用 mosquitto_sub -t in_topic
,在另一个终端中我可以使用 mosquitto_pub -h test.mosquitto.org -t in_topic -m message
。我在使用 mosquitto_sub 命令的第一个终端中收到该消息。所以在这之后我假设桥工作得很好是正确的。但我无法弄清楚桥接到 cloudmqtt 似乎是什么问题。
Cloudmqtt 使用 mosquitto mqtt 代理,dioty 从 mosquitto 交叉到 Mosca mqtt 代理,不支持桥接但显然具有更好的可扩展性(此信息已由 dioty 客户服务提供给我)
编辑:我使用 Node-RED 解决了这个桥接问题。刚刚添加了一个 mqqt 输入并将其配置为本地 mosquitto 代理(端口 1883)和两个 mqtt 输出,用于 cloudmqtt 和 DIoTY。
在cloudmqtt上,注册好账号后(可爱的猫是免费的),去控制面板添加cloudmqtt实例,cloudmqtt会提供用户名和密码给你。在 Node-RED 中,通过添加服务器、用户名、密码和端口为 cloudmqtt 实例配置 mqtt 输出之一。
在 DIoTY 上,您还需要创建帐户或使用 google 或其他帐户登录。当您登录时,您将获得用户名,这将是您的邮件帐户和其他信息,如主机和端口,将发送到电子邮件帐户的密码。因此,要在 Node-RED 中使用它,您需要将主机(服务器)、用户名、密码和端口添加到 mqtt 输出。当您订阅或发布消息时,请记住您有根主题,例如:
/your_mail_account/topic
无论是订阅某个主题还是发布一些消息,您都需要添加根主题作为某种前缀。
完成此配置后,您需要部署更改,就是这样。因此,对于这种类型,我使用了 Node-RED。
最佳答案
我正在使用 windows 和 c9.io linux console 测试。
I find out that https://www.cloudmqtt.com/docs-faq.html#TLS_SSL
cloudmqtt.com server cert is signed by Comodo, which has the AddTrust CA as root. Most OSs comes with it by default, so can you point to your default trust/CA store.
方法01
Click Start, click Start Search, type mmc, and then press ENTER.
On the File menu, click Add/Remove Snap-in.
Under Available snap-ins, click Certificates,and then click Add.
Under This snap-in will always manage certificates for, click Computer account, and then click Next.
Click Local computer, and click Finish.
If you have no more snap-ins to add to the console, click OK.
In the console tree, double-click Certificates.
Click to Trusted Root Certification Authorities > Certificates store.
Right-click AddTrust External CA Root
Click Export to Export the certificates and follow the steps in the Certificate Export Wizard, Export File Format choose Base-64 encoded X.509(CER).
Save the ca.cer to **C:\Program Files\mosquitto**
方法02
I get the cert here : www.tbs-certificates.co.uk/FAQ/en/357.html
AddTrust CA Root cert : http://www.tbs-x509.com/AddTrustExternalCARoot.crt
- Copy AddTrustExternalCARoot.crt to C:\Program Files\mosquitto\
- Double click AddTrustExternalCARoot.crt, Install Certificate...
window
I'm using mosquitto 1.4.11, windows, mosquitto.conf file I use difference name(cloud.conf), It look like this:
connection cloudmqtt
address xxx.cloudmqtt.com:<ssl-port>
remote_username <username_of_the_user_on_cloudmqtt>
remote_password <password_of the_user_on_cloudmqtt>
remote_clientid cloud.mqtt
bridge_protocol_version mqttv311
try_private true
notifications false
start_type automatic
topic # both 2
# Method 01
bridge_cafile ca.cer
# Method 02
#bridge_cafile AddTrustExternalCARoot.crt
bridge_insecure false
cleansession false
local_clientid local.mosquitto
Run cmd.exe
C:\Program Files\mosquitto> mosquitto.exe -c cloud.conf -v
1490627692: mosquitto version 1.4.11 (build date 20/02/2017 23:24:29.40) starting
1490627692: Config loaded from cloud.conf.
1490627692: Opening ipv6 listen socket on port 1883.
1490627692: Opening ipv4 listen socket on port 1883.
1490627692: Bridge local.mosquitto doing local SUBSCRIBE on topic #
1490627692: Connecting bridge cloudmqtt (xxx.cloudmqtt.com:<ssl-port>)
1490627692: Bridge cloud.mqtt sending CONNECT
1490627693: Received CONNACK on connection local.mosquitto.
1490627693: Bridge local.mosquitto sending SUBSCRIBE (Mid: 1, Topic: #, QoS: 2)
1490627693: Received SUBACK from local.mosquitto
...
Now, my local mosquitto broker bridged cloudmqtt.com in 2 way communication.
Linux
Simple try at c9.io linux console using method 02 (AddTrustExternalCARoot.crt), the output as below.
$ mosquitto -c cloud.conf -v -p 8080
1490634446: mosquitto version 1.4.11 (build date Fri, 03 Mar 2017 15:11:39 +0000) starting
1490634446: Config loaded from cloud.conf.
1490634446: Opening ipv4 listen socket on port 8080.
1490634446: Opening ipv6 listen socket on port 8080.
1490634446: Bridge c9.mosquitto doing local SUBSCRIBE on topic #
1490634446: Connecting bridge cloudmqtt2c9 (xxx.cloudmqtt.com:<ssl-port>)
1490634446: Connecting bridge cloudmqtt2c9 (xxx.cloudmqtt.com:<ssl-port>)
1490634446: Bridge cloud.mqtt.c9 sending CONNECT
1490634446: Received CONNACK on connection c9.mosquitto.
1490634446: Bridge c9.mosquitto sending SUBSCRIBE (Mid: 1, Topic: #, QoS: 2)
1490634447: Received SUBACK from c9.mosquitto
...
树莓派
复制 AddTrustExternalCARoot.crt 到与 cloud.conf 相同的目录
connection pi2cloudmqtt
address xxx.cloudmqtt.com:<ssl-port>
remote_username <username_of_the_user_on_cloudmqtt>
remote_password <password_of the_user_on_cloudmqtt>
remote_clientid cloud.mqtt.pi
bridge_protocol_version mqttv311
try_private true
notifications false
start_type automatic
topic # both 2
# Method 01
#bridge_cafile ca.cer
# Method 02
bridge_cafile AddTrustExternalCARoot.crt
bridge_insecure false
cleansession false
local_clientid pi.mosquitto
$ mosquitto -c cloud.conf -v
关于cloud - 将本地蚊子桥接到云代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34255907/
我完全不同意配置代理来检查我正在开发的应用程序的 HTTP(S) 流量。我试过运行 Fiddler2 和 Charles Web Proxy,它们都在 127.0.0.1:888 上运行,并使用以下参
我有一个 AWS 环境,其中有几个实例没有预安装 SSM 代理,也没有 key 对,有没有办法在不使用 SSH 登录我的实例的情况下安装 SSM 代理? 在此先感谢您的帮助! 最佳答案 没有。这是一个
在本教程中,您将借助示例了解 JavaScript 代理。 在 JavaScript 中,proxy(代理对象)用于包装对象并将各种操作重新定义到对象中,例如读取、插入、验证等。代理允许您向对
我有一个基于 Martini 的小型应用程序,但遇到了一个我无法解决的问题。 我想添加一个应用程序功能,允许用户从第三个服务器获取文件,并在 HTTP header 中进行一些更改。某种代理。这些文件
结构对比 讲实话,博主当初学习完整设计模式时,这三种设计模式单独摘哪一种都是十分清晰和明确的,但是随着模式种类的增加,在实际使用的时候竟然会出现恍惚,例如读开源代码时,遇到不以模式命名规范的代码时,
我正在尝试代理运行 ELK 的后端服务器。这是我的环境信息: root@proxy:~# root@proxy:~# cat /etc/*release DISTRIB_ID=Ubuntu DISTR
我需要为我的 java 应用程序编写一个代理,它在每个数组创建时执行一些特定的操作。到目前为止,我无法找到在此事件上运行我的代码的任何方法。 java.lang.instrument.ClassFil
PHP 代理如何工作? 我希望制作一个类似于其他 php 代理的小脚本 但是它实际上是如何工作的呢? 最佳答案 我正在考虑一个 PHP 代理,用于绕过 AJAX Sane Origin 策略。如果您需
我有一个 Electron 应用程序,试图通过该应用程序从同一网络调用url,但是出于安全考虑,我考虑了使用代理的想法。 function createWindow () { const mai
我有 1 台计算机,安装了 1 个网卡。网卡有 10 个 IP 地址分配给它。我在那里运行了一个 Windows 桌面应用程序。该应用程序基本上是一个调用 1 个特定网站的网络浏览器。 我想要实现的是
我想将 Burp 配置为我的 java 代码的代理,以查看请求和响应。Burp 作为 Web 浏览器之间的代理可以很好地工作,但它不适用于 Java 应用程序。 我已经在代码中添加了这样的行: Web
据我所知,在Spring AOP中,当我们想要拦截某些方法调用时,我们会配置一个具有与所需方法调用相匹配的切入点配置的Aspect。也就是说,我们在Aspect端配置拦截。 有没有一种方法可以完全从相
这可能是一个常见问题,但是:我有一个正在向 发出请求的应用程序elldmess.cz/api/... 但是这个api已经没有了。 现在我想要“东西”,即 catch 对 elldmess.cz/api
我正在尝试在 Android 中创建代理,但我必须使用套接字。我已经阅读了很多教程并提出了以下代码。不幸的是,浏览器似乎没有获得任何数据,一段时间后它显示标准网页,说网页不可用。可能是什么原因?感谢您
我在使用此代码时遇到了一些问题,具体取决于我使用的浏览器,有些 URL 在 IE 中显示正确,但在 Firefox 中显示为纯文本(例如 www.microsoft.es 在 IE 上看起来不错,但在
我正在尝试通过 urllib 获取一些 url 并通过我的代理进行 Mechanize 。 使用 mechanize 我尝试以下操作: from mechanize import Browser im
我安装了一个嵌入式设备(光伏转换器),它提供了一个正常的 http Web 界面(信息和设置)。该转换器具有用户身份验证,但只能通过 http 进行。出于安全考虑,我不想将服务器直接发布到互联网上。在
我正在搜索有关如何使用支持 HTTPS 的 Ruby 编写代理的一些示例。我有一个使用 Webricks HTTPProxyServer 实现的简单代理,但我注意到,HTTPS 流量只是隧道传输(它应
我的一位客户刚收到他选择的开发商订购的软件,让我看一下并准备托管程序。 这是一个 Java (jar) 应用程序,到目前为止一切顺利......但我看到了一些可疑的东西,软件每隔 60 分钟左右连接到
我试图在 C# 中创建一个 HTTPS 代理服务器。这里有人发布了解决方案: string host = "encrypted.google.com"; string
我是一名优秀的程序员,十分优秀!