最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已搞懂】goagent(GAE)的代理不支持ftp的21端口

工作和技术 crifan 3026浏览 0评论

【背景】

想要尝试通过之前折腾过的goagent,去实现代理访问我的ftp站点:

ftp.crifan.com

所以,先去filezilla中设置好代理:

filezilla edit settings

general proxy added 127 ip and 8087 port

然后再去连接ftp,结果连接失败:

状态:    通过代理连接到 ftp.crifan.com
状态:    正在连接 127.0.0.1:8087…
状态:    与代理连接建立,进行握手…
响应:    代理回复: HTTP/1.1 200 OK
状态:    连接建立,等待欢迎消息…
错误:    连接超时
错误:    无法连接到服务器

对应的goagent输出为:

INFO – [Jun 03 10:38:18] 127.0.0.1:56334 "GAE CONNECT ftp.crifan.com:21 HTTP/1.1" – –
ERROR – [Jun 03 10:38:38] ssl.wrap_socket(self.sock=<socket at 0x2aa34d0 fileno=916 sock=127.0.0.1:8087 peer=127.0.0.1:56334>) failed: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol

 

【解决过程】

1.后来参考:

Reading file from FTP URL in Google App Engine, FileNotFoundException

得知,Google App Engine – Making Requests中的解释:

An app can fetch a URL using HTTP (normal) or HTTPS (secure). The URL specifies the scheme to use: http://... or https://...

The URL to be fetched can use any port number in the following ranges: 80-90, 440-450, 1024-65535. If the port is not mentioned in the URL, the port is implied by the scheme: http://... is port 80, https://... is port 443.

即,对于21端口,不支持,所以,无法使用ftp的21端口的。

 

【总结】

除非,另外故意去到服务器端,修改自己的ftp的端口,改成别的,然后或许此处才能用上goagent的代理去访问对应的ftp。

转载请注明:在路上 » 【已搞懂】goagent(GAE)的代理不支持ftp的21端口

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
80 queries in 0.167 seconds, using 22.10MB memory