Advertisement
grungies1138

Untitled

May 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2. require __DIR__ . '/vendor/autoload.php';
  3. \Ratchet\Client\connect('ws://127.0.0.1:8888')->then(function($conn) {
  4. $conn->on('message', function($msg) use ($conn) {
  5. echo $msg;
  6. $conn->close();
  7. });
  8. $conn->send(json_encode($_POST["data"]));
  9. }, function ($e) {
  10. echo "Could not connect: {$e->getMessage()}\n";
  11. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement