XML-RPC service

Client :

my $server_url = 'http://127.0.0.1:6000/RPC2'; my $server = Frontier::Client->new( url => $server_url, username => 'token', password => $token ) or die "Не могу выполнить : $!"; my $result = $server->call('sample.calc', $arg) or die "Не могу выполнить : $!"; 

Server :

 ... my $methods = { 'sample.calc' => \&calc }; my $d = Frontier::Daemon->new( LocalPort => 6000, methods => $methods ) or die "Couldn't start HTTP server: $!"; sub calc {....} 

The XML-RPC service works without problems, but basic authentication of the client is required. I tried to pull out the headers, but this did not solve the problem:

 while (my $c = $d->accept) { if (my $r = $c->request->header('Authorization')) { ... } 

How to add basic authentication here?

    0