Perl, ip6 and XML RPC

  • Thread starter Frédéric Perrin
  • Start date
F

Frédéric Perrin

Hello list,

I want to talk to an XML RPC service over ip6 (the server doesn't
listen over ip4). However, with the three modules I tried so far
(XML::RPC, RPC::XML, Frontier::RPC::Client), it tries to do the request
over ip4, even though the hostname I gave only resolve to ip6. I know
for a fact that it should work, as the same script in Python works.

Actually, all of this is happening in fBSD jails ; if I "tcpdump -v -i
lo0 port 6800", I see the request going to some other ip4 (the
ip4 address of the jail in which the Perl script is running), so of
course the connection fails. ; this last bit of information may be of a
low entropy, since it really shouldn't matter.

So, how can I use Perl to make XML RPC calls to an ip6 server?

For instance :

% host perso.priv.fperrin.net
perso.priv.fperrin.net has IPv6 address fd93:c8e5:9cb3::3
% cat ariactl.pl
use strict;
use warnings;
use Frontier::Client;
my $ariactl = Frontier::Client->new(url =>
"http://user:PaSSw0rd\@perso.priv.fperrin.net:6800/rpc");
my $v = $ariactl->call("getVersion");
print $v;
% perl ariactl.pl
500 Can't connect to perso.priv.fperrin.net:6800 (connect: Connection
refused)
zsh: exit 61 perl ariactl.pl
% cat ariactl.cmdline.py
from xmlrpclib import ServerProxy
aria2 = ServerProxy("http://user:[email protected]:6800/rpc").aria2
v = aria2.getVersion()
print v
% python ariactl.cmdline.py
{'version': '1.8.1', 'enabledFeatures': ['BitTorrent', 'GZip', 'HTTPS',
'Message Digest', 'Metalink', 'XML-RPC']}
 
F

Frédéric Perrin

Le Vendredi 05 à 23:45, Frédéric Perrin a écrit :
I want to talk to an XML RPC service over ip6 (the server doesn't
listen over ip4). However, with the three modules I tried so far
(XML::RPC, RPC::XML, Frontier::RPC::Client), it tries to do the
request over ip4, even though the hostname I gave only resolve to
ip6.

A (the?) solution is to « use Net::INET6Glue::INET_is_INET6 » before
use()ing the actual XML RPC module. It worked with all the three
modules I tried.

Question: why isn't this the default, in 2010?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top