FTP-Proxy-Problem

Discussion in 'Perl Misc' started by Hirgumir, Jun 27, 2005.

  1. Hirgumir

    Hirgumir Guest

    Hi,

    I have a problem with ftpconnection via proxy.

    |--------------------| |------| |------|
    |local mit ftp client| -> |proxy | -> |host |
    |--------------------| |------| |------|

    The perlscript looks als follows: (i am using Linux)
    #!/usr/local/bin/perl -w
    use strict;

    use Net::FTP;

    my $TRUE = 1;
    my $FALSE = 0;

    my $prox="www-proxy.xxxxxxx:8080";
    my $host="xxxxxx";

    my $ftp = Net::FTP->new($host,Firewall => $prox, #thid is line 15
    Debug => 1,
    Timeout => 1000,
    Passive => $TRUE) or
    die "OOps\n";

    $ftp->login("xxxxxxxx",'xxxxxxxx');

    $ftp->binary();

    my $result = $ftp->put("hallo","deldies.ftpt");

    $ftp->quit();

    This script writes folloing output:

    Net::FTP>>> Net::FTP(2.72)
    Net::FTP>>> Exporter(5.57)
    Net::FTP>>> Net::Cmd(2.24)
    Net::FTP>>> IO::Socket::INET(1.27)
    Net::FTP>>> IO::Socket(1.28)
    Net::FTP>>> IO::Handle(1.23)
    Net::FTP: Unexpected EOF on command channel at ./ftptest.pl line 15
    OOps


    The connection works with "TotalCommnder" on a windows computer. The
    connection and the filetransfer are working. The proxy is the same.

    I would be glad. if anybody could help me to acomplish it with the
    script on Linux.

    Thanks in advance

    Hirgumir
    Hirgumir, Jun 27, 2005
    #1
    1. Advertising

  2. In article <>,
    Hirgumir <> wrote:
    >Hi,
    >
    >I have a problem with ftpconnection via proxy.
    >
    >|--------------------| |------| |------|
    >|local mit ftp client| -> |proxy | -> |host |
    >|--------------------| |------| |------|
    >
    >The perlscript looks als follows: (i am using Linux)
    >#!/usr/local/bin/perl -w
    >use strict;
    >
    >use Net::FTP;
    >
    >my $TRUE = 1;
    >my $FALSE = 0;
    >
    >my $prox="www-proxy.xxxxxxx:8080";
    >my $host="xxxxxx";
    >
    >my $ftp = Net::FTP->new($host,Firewall => $prox, #thid is line 15
    > Debug => 1,
    > Timeout => 1000,
    > Passive => $TRUE) or
    >die "OOps\n";
    >
    > $ftp->login("xxxxxxxx",'xxxxxxxx');
    >
    > $ftp->binary();
    >
    >my $result = $ftp->put("hallo","deldies.ftpt");
    >
    > $ftp->quit();
    >
    >This script writes folloing output:
    >
    >Net::FTP>>> Net::FTP(2.72)
    >Net::FTP>>> Exporter(5.57)
    >Net::FTP>>> Net::Cmd(2.24)
    >Net::FTP>>> IO::Socket::INET(1.27)
    >Net::FTP>>> IO::Socket(1.28)
    >Net::FTP>>> IO::Handle(1.23)
    >Net::FTP: Unexpected EOF on command channel at ./ftptest.pl line 15
    >OOps
    >
    >
    >The connection works with "TotalCommnder" on a windows computer. The
    >connection and the filetransfer are working. The proxy is the same.
    >
    >I would be glad. if anybody could help me to acomplish it with the
    >script on Linux.
    >


    Pure guess but you may need to set the FirewallType option
    From Net::FTP docs:

    FirewallType - The type of firewall running on the
    machine indicated by Firewall. This can be overridden by
    an environment variable "FTP_FIREWALL_TYPE". For a list
    of permissible types, see the description of
    ftp_firewall_type in Net::Config.

    HTH,
    --
    Charles DeRykus
    Charles DeRykus, Jun 28, 2005
    #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. someone

    FTP over SSL vs FTP over SSH

    someone, Apr 24, 2004, in forum: Java
    Replies:
    1
    Views:
    4,566
    iksrazal
    Apr 25, 2004
  2. Replies:
    3
    Views:
    5,600
  3. jakecjacobson

    FTP example going through a FTP Proxy

    jakecjacobson, Jan 7, 2009, in forum: Python
    Replies:
    3
    Views:
    2,049
    jakecjacobson
    Jan 8, 2009
  4. Vin Raja

    FTP : Time problem (net/ftp)

    Vin Raja, Jun 7, 2007, in forum: Ruby
    Replies:
    0
    Views:
    93
    Vin Raja
    Jun 7, 2007
  5. D. Buck
    Replies:
    2
    Views:
    464
    D. Buck
    Jun 29, 2004
Loading...

Share This Page