Files
OpenFlux/deploy/phpbox/test/sendserver.php
p1neappleXpress d3d67eff8b Mode without a server: a free PHP exit on any hosting (stream mux, flow control, installer, full tunnel) (#137)
The exit is a small PHP program on an ordinary web hosting, reached through cups.online or Mail.ru. See the PR for the list.
2026-10-01 01:49:46 +03:00

12 lines
425 B
PHP

<?php
// Test helper: writes endless data to whoever connects (a bulk download). php sendserver.php <port>
[$_, $port] = $argv;
$srv = stream_socket_server("tcp://127.0.0.1:$port", $e, $es) or exit(1);
echo "ready\n";
$chunk = str_repeat('x', 65536);
while ($c = @stream_socket_accept($srv, 30)) {
$until = microtime(true) + 6;
while (microtime(true) < $until && @fwrite($c, $chunk) !== false) { }
@fclose($c);
}