Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require __DIR__ . '/vendor/autoload.php';
- \Ratchet\Client\connect('ws://127.0.0.1:8888')->then(function($conn) {
- $conn->on('message', function($msg) use ($conn) {
- echo $msg;
- $conn->close();
- });
- $conn->send(json_encode($_POST["data"]));
- }, function ($e) {
- echo "Could not connect: {$e->getMessage()}\n";
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement