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
是否可以通过基于Swow\Socket 实现一个WebSocket 以及 HTTP2 客户端
如下示例
WebSocket Client
<?php declare(strict_types=1); namespace Swow\Client; use Psr\Http\Message\UriInterface; use Swow\Psr7\Message\WebSocketFrameInterface; /** * Class WebSocket * @package Swow\Client */ class WebSocket { /** * WebSocket constructor. * @param UriInterface $uri * @param array $options Headers 以及 SSL证书相关配置 */ public function __construct(UriInterface $uri, array $options = []) { } /** * 接收消息 * @param int $timeout * @return WebSocketFrameInterface */ public function receive(int $timeout = -1): WebSocketFrameInterface { } /** * 发送数据到服务 * @param $data * @return bool */ public function send($data): bool { } /** * 关闭连接 * @return bool */ public function close(): bool { } }
HTTP2 Client
<?php declare(strict_types=1); namespace Swow\Client; use Psr\Http\Message\UriInterface; use Psr\Http\Message\MessageInterface; /** * Class HTTP2 * @package Swow\Client */ class HTTP2 { /** * WebSocket constructor. * @param UriInterface $uri * @param array $options Headers 以及 SSL证书相关配置 */ public function __construct(UriInterface $uri, array $options = []) { } /** * 接收消息 * @param int $timeout * @return MessageInterface */ public function receive(int $timeout = -1): MessageInterface { } /** * 关闭连接 * @return bool */ public function close(): bool { } }
The text was updated successfully, but these errors were encountered:
WebSocket 已经有实现了。http2这个有点复杂
Sorry, something went wrong.
No branches or pull requests
是否可以通过基于Swow\Socket 实现一个WebSocket 以及 HTTP2 客户端
如下示例
The text was updated successfully, but these errors were encountered: