Skip to content

Instantly share code, notes, and snippets.

@igorw igorw/devnull.php
Created Apr 4, 2013

Embed
What would you like to do?
Implementation of RFC 863 aka /dev/null as a service, using React.
<?php
require __DIR__.'/vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server($loop);
$socket->on('connection', function ($conn) {
$devNull = new React\Stream\WritableStream();
$conn->pipe($devNull);
});
$socket->listen(9);
$loop->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.