Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

监听多个端口,运行在不同的模式 #40

Open
ghost opened this issue Mar 29, 2017 · 3 comments
Open

监听多个端口,运行在不同的模式 #40

ghost opened this issue Mar 29, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 29, 2017

想用 laravoole 做几个事情,监听多个端口,使用多种协议。

例如启动一个 laravoole,监听 9050 端口,解析 FastCGI 协议。
再启动一个 laravoole,监听 9051 端口,解析 WebSocket 协议。

我想了下,是不是 laravoole config 需要增加一个 group 概念。兼容历史版本,以前的就放在 default group

[
   'group1' => [
      'base_config' => [
        'host' => '',
        'port' => '9050',
      ]
   ],
   'group2' => [
      'base_config' => [
        'host' => '',
        'port' => '9051',
      ]
   ]
]

命令

php artisan laravoole [start|stop|reload] --group=group1
@zeasly
Copy link

zeasly commented May 5, 2017

这个可以有,一个项目可能可以支持正常的http请求,可能也要可以响应websocket请求

@wudi
Copy link

wudi commented May 5, 2017

这个需求有点私有业务驱动,没必要集成项目内,直接启动两个实例即可,改改配置文件而已。
如果增加反而导致代码复杂,实际需求场景不大。

@ghost
Copy link
Author

ghost commented May 9, 2017

不太可能放到项目外。即使放到项目外,自己想办法启动了两个不同协议的 swoole_server,那如果需要调用 laravel 框架的功能,或者现有的 model 怎么办,本机再来个 RPC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants