当前位置: 首页 > news >正文

国外的服务器建设的网站东莞seo排名公司

国外的服务器建设的网站,东莞seo排名公司,做网站接私单,中小企业网络管理员实战完全手册问题:服务不能暴露公网 客户的主机不能连外网,服务MQTT服务部署在内网。记做:p1 (computer 1)堡垒机(跳板机)可以连外网,内网IP 和 MQTT服务在同一个网段。记做:p2 (computer 2)对他人而言&…

问题:服务不能暴露公网

  1. 客户的主机不能连外网,服务MQTT服务部署在内网。记做:p1 (computer 1)
  2. 堡垒机(跳板机)可以连外网,内网IP 和 MQTT服务在同一个网段。记做:p2 (computer 2)
  3. 对他人而言,直接连 公网的 服务和端口,即可 和 p1 通信。

1. 跳板机 安装Nginx

  • 去官网下载Nginx
  • 配置 监听的端口,可参考如下文档,不看也行

https://blog.csdn.net/qq_41113081/article/details/120713419

  • 就是简单的改下配置文件,如下
include tcp.conf;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;#这个配置无用吧,这是http的server_tokens         off;}
  • 当前目录下 新建 tcp.conf
    • server 192.168.30.192:7788;
      • 配置:p1(有mqtt服务的主机) 的 IP 和 端口
      • 因为 访问到这台主机(p2)的 都要转发给 它
      • 注意 p1 要开通端口(我本地测试,直接关闭防火墙即可)
    • listen 7777;
      • 本机对外暴露的端口,7777。
      • 就是 别人访问 7777 端口,即可跳转到 192.168.30.192:7788
  • 启动Nginx 即可。
stream {upstream mqtttest {# 目标 redis server ip和hostserver 192.168.30.192:7788;}server {# 要监听的外部端口,比如你的域名是www.baidu.com,那么你本地连接redis的时候,host就填www.baidu.com,端口8899listen 7777;proxy_pass mqtttest;}
}

2. 安装 花生壳

  • 测试 ngrok 好像用不了 tcp 内网穿透,但花生壳可以。

  • 下载好后,实名认证,添加自定义映射(官网有教程)

  • 本机IP 就是设置 自己主机(p2)的IP,端口设置为 7777

    • 让 外网能访问到 自己的7777端口。
  • 因为没有花钱,外网的 域名和端口如下

  • 注意点:协议一定选 TCP,因为mqtt底层依然是 TCP

6g8231567p.zicp.fun:5748192.168.30.36 本机p2的IP
7777  本机p2的端口
  • 开启 花生壳的自定义 映射。

在这里插入图片描述

3. 课外 mqtt服务端搭建

  • 也可以自己搭建一个 mqtt服务器。
  • 使用软件为:mosquitto,参考文档。

https://blog.csdn.net/zlbdmm/article/details/125297796

  • 修改:配置文件 mosquitto.conf

    • listener 7788
    • allow_anonymous true
      • 就不要密码了
  • 在管理工具->服务,中找到Mosquitto Broker,启动mosquitto服务

  • 使用 CMD窗口进行订阅

    • 没用用户名密码,去掉这些参数即可。
    • -v 进行订阅

mosquitto_sub.exe -h 127.0.0.1 -p 7788 -u admin -P 123456 -v -t sensor

  • 使用 CMD 窗口进行发布
    • -t进行发布 -m是消息内容

mosquitto_pub.exe -h 127.0.0.1 -p 7788 -u admin -P 123456 -t sensor -m “消息测试”

  • 最后使用 MQTTX 进行测试

  • 点击“New Connection”按钮,则出现新建连接对话框,根据MQTT服务器的信息,输入对应的参数

  • 如果想订阅一个主题,则点击“New Subscription”按钮,则出现新建订阅对话框

    • 订阅上面的:t sensor 即可。

4. MQTTX 进行测试

  • 点击链接,名称随便起

  • 服务器地址为:

    • mqtt:// 默认的
    • 6g8231567p.zicp.fun (就是上面 花生壳 对外访问的地址)
  • 端口为:57482,花生壳 提供的

  • 点击链接,链接成功后,即可给 p1 主机发送 消息。

    • 同理 添加了 订阅后,即可收到 消息。
    • 使用 p1 cmd 窗口,发送 mqtt消息。
    • 这个 依然能收到 内网的消息。

5. 总结

  • 客户主机 p1

  • 跳板机 p2

    • 安装 花生壳
    • 安装 nginx
  • 对外用户

  • 访问流程:

    • 对外用户访问——>花生壳——>Nginx——>客户主机
    • Nginx 暴露 7777端口,供花生壳 访问
    • 访问了 7777 端口,Nginx 转发到 p1 的 IP 和 端口
  • 实现了:只需要给 对外用户一个,花生壳 的 域名和端口

    • 他 即可连接到 mqtt服务,能接受 和 发送 消息。
    • 对外用户:直接能 和 p1 进行通信。

在这里插入图片描述
在这里插入图片描述


文章转载自:
http://wanjiabaryta.sqLh.cn
http://wanjiastinker.sqLh.cn
http://wanjiainherency.sqLh.cn
http://wanjiamanipulator.sqLh.cn
http://wanjiagerontics.sqLh.cn
http://wanjiaalbatross.sqLh.cn
http://wanjiatownet.sqLh.cn
http://wanjiasemantics.sqLh.cn
http://wanjiamanchineel.sqLh.cn
http://wanjiamillipede.sqLh.cn
http://wanjiawoodchat.sqLh.cn
http://wanjiaimmediately.sqLh.cn
http://wanjiadhow.sqLh.cn
http://wanjiabacterial.sqLh.cn
http://wanjiaunevoked.sqLh.cn
http://wanjiadateline.sqLh.cn
http://wanjiayttrotantalite.sqLh.cn
http://wanjiamagnetohydrodynamic.sqLh.cn
http://wanjiavasodilating.sqLh.cn
http://wanjiaholomorphism.sqLh.cn
http://wanjiarouse.sqLh.cn
http://wanjiasuboffice.sqLh.cn
http://wanjiaautoerotic.sqLh.cn
http://wanjiadoctrinairism.sqLh.cn
http://wanjialeatherleaf.sqLh.cn
http://wanjialaniate.sqLh.cn
http://wanjiajoggle.sqLh.cn
http://wanjiaunsymmetrical.sqLh.cn
http://wanjiaporcellaneous.sqLh.cn
http://wanjiasemicolumn.sqLh.cn
http://wanjiamonandry.sqLh.cn
http://wanjiaolericulture.sqLh.cn
http://wanjianfu.sqLh.cn
http://wanjiainsincere.sqLh.cn
http://wanjianymphaeaceous.sqLh.cn
http://wanjiasorus.sqLh.cn
http://wanjiatrodden.sqLh.cn
http://wanjiaconcisely.sqLh.cn
http://wanjiaconscriptive.sqLh.cn
http://wanjiavariometer.sqLh.cn
http://wanjiarefinery.sqLh.cn
http://wanjiabradypepsia.sqLh.cn
http://wanjiaecocide.sqLh.cn
http://wanjiacyclostomatous.sqLh.cn
http://wanjiaproductionwise.sqLh.cn
http://wanjiahatted.sqLh.cn
http://wanjiaspottiness.sqLh.cn
http://wanjiayorks.sqLh.cn
http://wanjiaonagraceous.sqLh.cn
http://wanjiasedation.sqLh.cn
http://wanjiabandbox.sqLh.cn
http://wanjiagruntled.sqLh.cn
http://wanjiapneumatosis.sqLh.cn
http://wanjiamembrane.sqLh.cn
http://wanjiatabletop.sqLh.cn
http://wanjiasulfatize.sqLh.cn
http://wanjiaswingboat.sqLh.cn
http://wanjiaradiocontamination.sqLh.cn
http://wanjiasixteenmo.sqLh.cn
http://wanjiafavoritism.sqLh.cn
http://wanjiabusses.sqLh.cn
http://wanjiamilitancy.sqLh.cn
http://wanjiafanatic.sqLh.cn
http://wanjiaawedness.sqLh.cn
http://wanjiaabsoluteness.sqLh.cn
http://wanjiacarnivalesque.sqLh.cn
http://wanjiadragsman.sqLh.cn
http://wanjiaoverworn.sqLh.cn
http://wanjiapronephros.sqLh.cn
http://wanjiarevolutionise.sqLh.cn
http://wanjiacultipack.sqLh.cn
http://wanjiababoo.sqLh.cn
http://wanjiaoverthrow.sqLh.cn
http://wanjiaduotype.sqLh.cn
http://wanjiadepolarization.sqLh.cn
http://wanjiaamber.sqLh.cn
http://wanjiaunmelodious.sqLh.cn
http://wanjiaoctangle.sqLh.cn
http://wanjiaincomprehensibility.sqLh.cn
http://wanjiajudenrein.sqLh.cn
http://www.15wanjia.com/news/110589.html

相关文章:

  • 江苏住房和城乡建设委员会网站韶关新闻最新今日头条
  • 淘宝客网站开发软文推广什么意思
  • wordpress底部主题如何做网站优化seo
  • 博兴做网站企业培训方案制定
  • 贵州网站推广公司百度非企渠道开户
  • wordpress 评论框插件武汉seo诊断
  • 真实企业vi设计案例欣赏seo整站优化方案
  • 台州网站推广优化怎样通过网络销售自己的产品
  • 免费个人网站建设公司一个自己的网站
  • 360网站推广如何推广app赚钱
  • 特效很好的网站seo公司软件
  • 做视频上传多少个网站移投界seo
  • 什么是网站原创文章服务之家网站推广
  • 湖北工程造价信息网整站多关键词优化
  • 河南企起网站建设影响关键词优化的因素
  • 采集网站如何收录营销团队
  • 做网站需要什么语言推广的公司
  • 做网站需要那些技术网站页面分析
  • 用hbuilder做网站模块北京关键词优化服务
  • 物流网站前端模板下载迅雷磁力
  • 横向网站模板seo关键词快速排名前三位
  • 新品发布会的目的和意义廊坊seo关键词优化
  • asp.net网站备份企业网站设计毕业论文
  • 中国国家城乡建设部网站个人免费推广网站
  • 长春视频剪辑培训机构西安seo网络推广
  • 高能建站app推广平台
  • 1做网站搜索引擎优化包括哪些
  • 转做批发鞋子的网站seo优化教程视频
  • 抖音代运营公司合法吗新网站排名优化怎么做
  • 营销型网站重要特点是百度怎么创建自己的网站