承接 volkerschulz/sse-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

volkerschulz/sse-client

最新稳定版本:0.9.2

Composer 安装命令:

composer require volkerschulz/sse-client

包简介

Client for Server-Sent Events

README 文档

README

Client to receive server-sent events (from OpenAI API runner for example)

Installation

The recommended way to install SseClient is through Composer.

composer require volkerschulz/sse-client

Usage

Minimal:

use volkerschulz\SseClient;

$client = new SseClient('https://example.com');
foreach($client->getEvents() as $event) {
    // Handle single event 
    echo $event->getData();
}


POST request w/ options:

use volkerschulz\SseClient;

$sse_options = [
    'reconnect' => false,
    'read_timeout' => 5
];

$client = new SseClient('https://example.com', $sse_options);

$http_options = [
    'json' => [
        'foo' => 'bar'
    ],
    'allow_redirects' => false
];

foreach($client->getEvents($http_options, 'POST') as $event) {
    // Handle single event 
}

List of all options

Security

If you discover a security vulnerability within this package, please send an email to security@volkerschulz.de. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced.

License

This package is made available under the MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 166
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-04