1. Go to this page and download the library: Download reactphp-x/tunnel-stream library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
reactphp-x / tunnel-stream example snippets
use ReactphpX\TunnelStream\TunnelStream;
use React\Stream\ThroughStream;
// 创建读写流
$read = new ThroughStream();
$write = new ThroughStream();
// 初始化隧道流
$tunnelStream = new TunnelStream($read, $write);
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
tenv('BOOT_FILE')) {
act\Stream\WritableResourceStream;
$tunnelStream = new TunnelStream(
new ReadableResourceStream(STDIN),
new WritableResourceStream(STDERR),
true
);
public function __construct(
Stream\ReadableStreamInterface $readStream,
Stream\WritableStreamInterface $writStream,
bool $canCallback = false
)
public function run(callable $closure): Stream\DuplexStreamInterface
public function ping(int $timeout = 3): PromiseInterface
public function close(): void
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.