http://www.perlmonks.org?node_id=1064675


in reply to perl client for Socket.io

Hi, I make a client with the info that I found, but when I send a emit I get this from socket.io:
debug - client authorized info - handshake authorized qs3kbEVnsoRBhD9hq91S debug - destroying non-socket.io upgrade
My code is:
#!/usr/bin/perl -w use PocketIO::Client::IO; my $socket = PocketIO::Client::IO->connect("http://localhost:1506"); my $cv = AnyEvent->condvar; my $w = AnyEvent->timer( after => 5, cb => $cv ); $socket->on( 'message', sub { say $_[1]; } ); $socket->on( 'connect', sub { $socket->send('Parumon!'); $socket->emit( 'message', { name => 'name', message => 'msg emit' +} ); print "connected"; } ); $cv->wait;