Perl, ip6 and XML RPC

Discussion in 'Perl Misc' started by Frédéric Perrin, Feb 5, 2010.

  1. 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:p: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']}

    --
    Fred
    Frédéric Perrin, Feb 5, 2010
    #1
    1. Advertising

  2. 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?

    --
    Fred
    Frédéric Perrin, Feb 8, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RedHat_79
    Replies:
    0
    Views:
    395
    RedHat_79
    May 29, 2004
  2. Pere Montolio

    XML RPC to ONC XDR RPC

    Pere Montolio, Aug 11, 2004, in forum: XML
    Replies:
    0
    Views:
    695
    Pere Montolio
    Aug 11, 2004
  3. Ymtrader
    Replies:
    1
    Views:
    568
    Adam Tauno Williams
    Mar 15, 2011
  4. Shirish Joshi

    Ruby and Sun-RPC or ONC-RPC ?

    Shirish Joshi, Apr 7, 2004, in forum: Ruby
    Replies:
    0
    Views:
    171
    Shirish Joshi
    Apr 7, 2004
  5. Vladimir Konrad

    rpc (not xml-rpc)

    Vladimir Konrad, Sep 2, 2005, in forum: Ruby
    Replies:
    5
    Views:
    123
    Austin Ziegler
    Sep 3, 2005
Loading...

Share This Page