Advertisement
tristamoff

Untitled

Feb 18th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. //подключение библиотеки
  2. require('vendor/autoload.php');
  3. use WebSocket\Client;
  4.  
  5. //создание клиента
  6. $client = new Client("wss://ws.golos.io/");
  7.  
  8. //основной запрос
  9. $a = json_encode(
  10.   [
  11.     'id' => 1, 'method' => 'get_dynamic_global_properties'
  12.   ]
  13. );
  14.  
  15. //отправка запроса
  16. $client->send($a);
  17.  
  18. //вывод ответа
  19. print_r($client->receive());
  20.  
  21. //закрытие соединения
  22. $client->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement