Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP over HTTP Proxy 対応 #1

Open
miyamuko opened this issue Feb 13, 2012 · 0 comments
Open

FTP over HTTP Proxy 対応 #1

miyamuko opened this issue Feb 13, 2012 · 0 comments

Comments

@miyamuko
Copy link
Owner

Ruby の open-uri は FTP over HTTP proxy に対応している。
xl-open-uri でも対応する。

FTP over HTTP proxy 概要

  • client - proxy server 間は HTTP で通信
  • proxy server - FTP server 間は FTP で通信
  • FTP の RETR コマンドは HTTP GET に変換
  • FTP の STOR コマンドは HTTP PUT に変換
  • STOU, APPE とかは ないかな?

http://sonic64.com/2004-05-11.html

xl-open-uri 仕様

  • proxy サーバの指定方法
    • :proxy 引数で指定する
    • 環境変数 ftp_proxy は見る?
  • プロキシを使うか使わないかの判断は?
    • http の場合は WinHTTP がある程度面倒を見てくれている
    • ftp で接続するか http に変換するかは自分でやらなければいけない
  • meta データの取得
    • 今の xl-open-uri のプロトコルハンドラの仕様ではプロトコルハンドラを定義したパッケージの関数が呼ばれる
    • ftp なら xl-open-uri.protocols.ftp が http なら xl-open-uri.protocols.http が
    • FTP over HTTP proxy の場合は xl-open-uri.protocols.http に処理を丸投げできるようにする必要がある
  • GET への変換
    • これは簡単
  • PUT への変換
    • http のほうは送信するデータを :body 引数で指定するが、ftp のほうはストリームに書いてもらっている
    • ストリームに書かれたデータをすべて取得してから PUT?
    • または chunked upload?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant