简体   繁体   English

curl http 通过代理服务器连接到ftp URL

[英]curl http connect to ftp URL through proxy server

I am trying to do ftp over http proxy.我正在尝试通过 http 代理进行 ftp。 I read that it can be achieved by using http connect method.我读到它可以通过使用 http 连接方法来实现。

So i ran curl command from command line.所以我从命令行运行 curl 命令。

curl -X CONNECT --url 'ftp://ftp.kernel.org:21' -x http ://proxy_server.com:80

This is the output i get这是我得到的输出

curl -v -X CONNECT ftp ://ftp.kernel.org:21 -x http ://proxy_server.com:80
* About to connect() to proxy proxy_server.com port 80 (#0)
*   Trying 100.173.137.101... connected
* Connected to proxy_server.com (100.173.137.101) port 80 (#0)
> CONNECT ftp://ftp.kernel.org:21 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0     zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: ftp.kernel.org:21
> Accept: */*
> Proxy-Connection: Keep-Alive
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 200 Connection established
< 
220 Welcome to kernel.org

But when i enter the command 'user anonymous' or even 'help' command after this, i get no response from the server.但是,当我在此之后输入命令“匿名用户”甚至“帮助”命令时,我没有收到服务器的响应。

How to make this work?如何使这项工作?

Will work using this将使用这个工作

Curl -x proxy_url -D- destination_url curl -x proxy_url -D- destination_url

Would give you the response of connecting destination through given proxy会给你通过给定的代理连接目的地的响应

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM