Laravel 如何在GCP Flex环境中设置websocket?
我正在使用laravel 6,我想在google cloud Flex应用程序引擎平台上使用supervisor部署基于laravel的websocket服务器 我正在使用这个软件包:beyondcode/laravel websockets 我已经设置好了一切,一切都在本地机器上正常工作!在GCP上部署它的具体步骤是什么 我的附加命令-supervisord.confLaravel 如何在GCP Flex环境中设置websocket?,laravel,google-cloud-platform,websocket,laravel-websockets,Laravel,Google Cloud Platform,Websocket,Laravel Websockets,我正在使用laravel 6,我想在google cloud Flex应用程序引擎平台上使用supervisor部署基于laravel的websocket服务器 我正在使用这个软件包:beyondcode/laravel websockets 我已经设置好了一切,一切都在本地机器上正常工作!在GCP上部署它的具体步骤是什么 我的附加命令-supervisord.conf [program:websockets] command = php %(ENV_APP_DIR)s/artisan webs
[program:websockets]
command = php %(ENV_APP_DIR)s/artisan websockets:serve
enviroment = PORT="6001"
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile = /dev/stderr
stderr_logfile_maxbytes=0
user = root
autostart = true
autorestart = true
priority = 10
stopwaitsecs = 20
App.yaml
runtime: php
env: flex
runtime_config:
document_root: public
service: orders
skip_files:
- .env
#only for testing purpose.
manual_scaling:
instances: 1
env_variables:
APP_NAME: "Havn"
BROADCAST_DRIVER: pusher
PUSHER_APP_ID: SOMEID
PUSHER_APP_KEY: SOMEKEY
PUSHER_APP_SECRET: SOMESECRET
PUSHER_APP_CLUSTER: mt1
LARAVEL_WEBSOCKETS_PORT: 6001
PUSHER_SCHEME: https
PUSHER_HOST: 127.0.0.1
PUSHER_PORT: 6001
QUEUE_DRIVER: database
beta_settings:
cloud_sql_instances: "INSTANCE ID"
您可以在官方文档中找到如何使用WebSocket创建从客户端(如移动设备或计算机)到App Engine实例的持久连接
请考虑一个小时后WebSoCub连接将超时。