Hi there, I would like to create a client in perl that can connect to node js socket.io server. I tried this code
use strict; use AnyEvent; use AnyEvent::PocketIO::Client; use PocketIO::Client::IO; #use PocketIO::Client::IO; my $socket = PocketIO::Client::IO->connect("http://127.0.0.1:3001"); 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;
but got this error :
28 {"code":0,"message":"Transport unknown"} 0 at /usr/local/share/perl5/AnyEvent/PocketIO/Client.pm line 86. Can't call method "transport" on an undefined value at socket-perl.pl +line 9.
can anyone help with that ?
In reply to Node JS Socket.IO server with perl by mojo2405
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |