Home  >  Article  >  Backend Development  >  swoole-1.8.2 已发布,支持Http2.0协议

swoole-1.8.2 已发布,支持Http2.0协议

WBOY
WBOYOriginal
2016-06-20 12:36:021117browse



PHP的异步、并行、高性能网络通信引擎swoole已发布 1.8.2版本 ,此版本增加了对Http2.0协议的支持,另外修复了swoole-1.8.1版本存在的一些BUG。基于Http2.0协议,swoole_http_server可以支持单连接并发请求处理和主动PUSH。目前Swoole仅支持基于TLS1.2加密的H2模式,暂不支持H2C Upgrade模式。

Http2.0使用示例 :

$ssl_dir = realpath('../../tests/ssl');$serv = new swoole_http_server("0.0.0.0", 9501, SWOOLE_BASE, SWOOLE_SOCK_TCP | SWOOLE_SSL);$serv->set([    'ssl_cert_file' => $ssl_dir . '/ssl.crt',    'ssl_key_file' => $ssl_dir . '/ssl.key',    'open_http2_protocol' => true,]);$serv->on('Request', function(swoole_http_request $request, swoole_http_response $response) {    $response->end("<h1>Hello Swoole!</h1>\n");});$serv->start();

1.8.2其他重要更新:

  • 修复WebSocket服务器接收超过64K数据发生崩溃的问题

  • 修复多端口监听未设置回调函数导致程序崩溃的问题

  • 提升SSL/TLS隧道加密的安全等级,现在默认使用TLS1.2/ECDHA_RSA加密算法

  • 修复onFinish事件回调内存泄漏的问题

  • 修复BASE模式下task finish无法使用的问题

  • 增加log_level设置,可以选择错误日志的等级

下载地址:

  • GITHUB: https://github.com/swoole/swoole-src/releases/tag/swoole-1.8.2-stable

  • 开源中国: http://git.oschina.net/matyhtf/swoole/tree/swoole-1.8.2-stable

  • PECL: https://pecl.php.net/package/swoole/1.8.2

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn