最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Google App Engine在同一个应用程序上有两个端口

运维笔记admin14浏览0评论

Google App Engine在同一个应用程序上有两个端口

Google App Engine在同一个应用程序上有两个端口

我想在Google App Engine上运行节点js应用程序,但我的应用程序当前在两个不同的端口上运行两个协议。其中一个是端口8080(需要在Google App Engine上工作),另一个是1883,一个mqtt服务器。查看文档,我找不到任何可以使这个工作,实际上,服务器启动没有错误,但当然我无法连接到端口1883,只有http和https。

我需要知道这是否可行,如果是,我该如何转发该端口或代理呢?

我的app.yaml:

runtime: nodejs
env: flex
service: comms-server
network:
  name: default
  subnetwork_name: default
  forwarded_ports:
    - 1883/tcp

另外,我的VPC配置是:

回答如下:

请尝试以下方法:

network:
  forwarded_ports:
  - 1883
  instance_tag: comms-server

和:

gcloud compute firewall-rules create default-allow-comms-server \
  --allow tcp:1883 \
  --target-tags comms-server \
  --description "Allow  traffic on port 1883"
发布评论

评论列表(0)

  1. 暂无评论