ndshake::Client;
use Protocol::WebSocket::Handshake::Server;
use Protocol::WebSocket::Frame;
use JSON::XS;
use URI::Escape;
use Log::Any qw($log);
our $VERSION = '1.01';
sub new
{
my ($class, %
00));
my $msg = "chromi $id $method";
if($args) {
$msg .= " " . uri_escape(encode_json($args));
}
my $frame = Protocol::WebSocket::Frame->new($msg);
if($cb) {
$self
if($reply =~ /^\[(.*)\]$/s) {
&{$self->{callbacks}{$id}}($status, decode_json($1));
}
else {
die "error: $reply