Skip to content

Instantly share code, notes, and snippets.

@igorw
Created July 8, 2014 23:09
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/cde0271d661acbeef483 to your computer and use it in GitHub Desktop.
Save igorw/cde0271d661acbeef483 to your computer and use it in GitHub Desktop.
<?php
require 'vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server($loop);
$socket->on('connection', function ($conn) {
echo "Oh look! A connection!\n";
$conn->pipe($conn);
});
$socket->listen(1337);
$loop->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment