Google App Engine two ports on same application

生来就可爱ヽ(ⅴ<●) 提交于 2020-08-11 07:07:12

问题


I want to run a node js application on Google App Engine but my application is currently running two protocols, on two different ports. One of them is the port 8080 (which is required to work on Google App Engine) and the other one is 1883, a mqtt server. Looking the documentation, I couldn't find anything to make this works, actually, the server starts without errors but of course I can't connect to the port 1883, only the http and https.

I need to know if this is possible at all and if is, how do I forward that port or proxy that?

My app.yaml:

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

Also, my VPC configuration is:


回答1:


Try the following:

network:
  forwarded_ports:
  - 1883
  instance_tag: comms-server

And:

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


来源:https://stackoverflow.com/questions/54739590/google-app-engine-two-ports-on-same-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!