We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
目前无法实现一个服务暴露多个端口用于 HTTP/WS 服务,建议提供此功能用于满足一些工具型后台或后台的功能
The text was updated successfully, but these errors were encountered:
一直就可以的吧
Sorry, something went wrong.
@breath-co2 HTTP/WebSocket 服务器是主服务器,无法直接通过 listen 添加端口监听 HTTP/WebSocket 协议服务 https://wiki.swoole.com/wiki/page/16.html https://wiki.swoole.com/wiki/page/525.html
你需要加一个 open_websocket_protocol 参数(文档有相关参数说明),例如:
open_websocket_protocol
$port1 = $server->listen("127.0.0.1", 9501, SWOOLE_SOCK_TCP); $port1->set([ 'open_websocket_protocol' => true, ]);
同理,还有 open_http_protocol 和 open_http2_protocol 参数,另外需要注意的是,如果你是 new 了一个 http/websocket 的服务,又想监听普通的 tcp 端口,需要设置这些参数 false 才可以。
open_http_protocol
open_http2_protocol
No branches or pull requests
目前无法实现一个服务暴露多个端口用于 HTTP/WS 服务,建议提供此功能用于满足一些工具型后台或后台的功能
The text was updated successfully, but these errors were encountered: