Skip to content

Instantly share code, notes, and snippets.

@igorw
Created April 4, 2013 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorw/5310408 to your computer and use it in GitHub Desktop.
Save igorw/5310408 to your computer and use it in GitHub Desktop.
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