我尝试了this和this。但它只是不起作用。 AuthSend
返回空数组。可能我应该为你提供一些代码来讨论:
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Net::XMPP;
use Data::Dumper;
my $username = 'USERNAME';
my $password = 'PASSWORD';
my $connection = new Net::XMPP::Client;
my $r = $connection->Connect(
hostname => 'talk.google.com',
port => 5222,
componentname => 'gmail.com',
connectiontype => 'tcpip',
tls => 1
);
say Dumper $r;
my @r = $connection->AuthSend(
username => $username,
password => $password,
resource => 'test'
);
say Dumper \@r;
答案 0 :(得分:-1)
您可以尝试Net::XMPP::Client::GTalk。
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use Net::XMPP::Client::GTalk;
my $username = 'USERNAME';
my $password = 'PASSWORD';
# does all the connection-handling and authentication at once
my $client = Net::XMPP::Client::GTalk->new(
USERNAME => $username,
PASSWORD => $password,
);
say Dumper($client);