[#44289] [Ruby 1.9 - Feature #5128][Open] 日本語ドキュメントをUTF-8に — Shyouhei Urabe <shyouhei@...>
34 messages
2011/08/01
[#44290] Re: [Ruby 1.9 - Feature #5128][Open] 日本語ドキュメントをUTF-8に
— Kenta Murata <muraken@...>
2011/08/01
=E3=82=80=E3=82=89=E3=81=9F=E3=81=A7=E3=81=99=E3=80=82 =20
[#44294] Re: [ruby-dev:44290] Re: [Ruby 1.9 - Feature #5128][Open] 日本語ドキュメントをUTF-8に
— KOSAKI Motohiro <kosaki.motohiro@...>
2011/08/01
(2011/08/01 11:10), Kenta Murata wrote:
[#44297] Re: [ruby-dev:44294] Re: [ruby-dev:44290] Re: [Ruby 1.9 - Feature #5128][Open] 日本語ドキュメントをUTF-8に
— "Martin J. Dürst" <duerst@...>
2011/08/01
On 2011/08/01 12:04, KOSAKI Motohiro wrote:
[#44293] [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Nobuyoshi Nakada <nobu@...>
2011/08/01
[#44295] Re: [ruby-dev:44293] [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Urabe Shyouhei <shyouhei@...>
2011/08/01
(08/01/2011 11:52 AM), Nobuyoshi Nakada wrote:
[#44299] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Nobuyoshi Nakada <nobu@...>
2011/08/01
なかだです。
[#44302] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— KOSAKI Motohiro <kosaki.motohiro@...>
2011/08/01
(2011/08/01 13:28), Nobuyoshi Nakada wrote:
[#44382] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Ayumu Aizawa <ayumu.aizawa@...>
2011/08/12
あいざわです
[#44390] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Urabe Shyouhei <shyouhei@...>
2011/08/15
(08/12/2011 10:57 AM), Ayumu Aizawa wrote:
[#44392] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Nobuyoshi Nakada <nobu@...>
2011/08/16
(11/08/15 17:41), Urabe Shyouhei wrote:
[#44393] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— "NARUSE, Yui" <naruse@...>
2011/08/16
2011年8月16日10:15 Nobuyoshi Nakada <nobu@ruby-lang.org>:
[#44418] [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Ayumu AIZAWA <ayumu.aizawa@...>
2011/08/24
[#44431] Re: [ruby-dev:44418] [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— KOSAKI Motohiro <kosaki.motohiro@...>
2011/08/27
> あいざわです
[#44443] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Ayumu Aizawa <ayumu.aizawa@...>
2011/09/01
あいざわです
[#44444] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Urabe Shyouhei <shyouhei@...>
2011/09/01
誰からも文句が出ないのを見届けて今週中くらいを目安に卜部がpullします。
[#44445] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— KOSAKI Motohiro <kosaki.motohiro@...>
2011/09/01
> 誰からも文句が出ないのを見届けて今週中くらいを目安に卜部がpullします。
[#44446] Re: [Ruby 1.9 - Feature #5128] 日本語ドキュメントをUTF-8に
— Ayumu Aizawa <ayumu.aizawa@...>
2011/09/01
> 他のファイルもやる必要があるという話なので、自分でコミットしてもらったほうが
[#44304] [Ruby 1.9 - Feature #5133][Open] Array#unzip as an alias of Array#transpose — Kenta Murata <muraken@...>
6 messages
2011/08/01
[#44315] [Ruby 1.9 - Bug #5139][Open] sigsegv のスタックオーバフロー — Tomoyuki Chikanaga <nagachika00@...>
18 messages
2011/08/02
[#44329] [Ruby 1.9 - Bug #5151][Open] test/socket/test_socket.rb fail when udp connection failed — Ayumu AIZAWA <ayumu.aizawa@...>
16 messages
2011/08/02
[#44337] [Ruby 1.9 - Bug #5152][Open] TestDateNew#test_civil が GC.stress = true 下で Failure — Tomoyuki Chikanaga <nagachika00@...>
4 messages
2011/08/03
[#44368] [Ruby 1.9 - Feature #5180][Open] net/http の接続時に用いる IP アドレスの指定 — Yui NARUSE <naruse@...>
15 messages
2011/08/10
[#44378] [Ruby 1.9 - Feature #5180] net/http の接続時に用いる IP アドレスの指定
— Kazuhiro NISHIYAMA <redmine@...>
2011/08/11
[#44370] [Ruby 1.9 - Feature #5180] net/http の接続時に用いる IP アドレスの指定
— Yui NARUSE <naruse@...>
2011/08/10
[#44371] Re: [Ruby 1.9 - Feature #5180] net/http の接続時に用いる IP アドレスの指定
— Tanaka Akira <akr@...>
2011/08/10
2011年8月10日15:05 Yui NARUSE <naruse@airemix.jp>:
[#44372] Re: [Ruby 1.9 - Feature #5180] net/http の接続時に用いる IP アドレスの指定
— "NARUSE, Yui" <naruse@...>
2011/08/10
2011年8月10日15:20 Tanaka Akira <akr@fsij.org>:
[#44413] [Ruby 1.9 - Bug #5217][Open] lineno is broken when source code has about 7000 lines — Yusuke Endoh <mame@...>
11 messages
2011/08/23
[#44416] [Ruby 1.9 - Bug #5217] lineno is broken when source code has about 7000 lines
— Hiroshi Nakamura <nakahiro@...>
2011/08/24
[#44417] Re: [Ruby 1.9 - Bug #5217] lineno is broken when source code has about 7000 lines
— Yusuke ENDOH <mame@...>
2011/08/24
遠藤です。
[ruby-dev:44373] Re: [Ruby 1.9 - Feature #5180] net/http の接続時に用いる IP アドレスの指定
From:
tadanori kojima <tadanori.kojima@...2ts.com>
Date:
2011-08-10 09:21:30 UTC
List:
ruby-dev #44373
load balancer利用時のreal IPへの接続などのユースケースは理解できますが
-----
Net::HTTP.start("127.0.0.1") {|h|
print h.request_get( '/index.html' , {"host"=>"ruby-lang.org"}).body
}
※startはIP指定、リクエスト時のhostヘッダにホスト名
-----
というのがHTTP的なふつうの対処な気がします
ホストがv4/v6の両アドレスを持つ場合などにv4で接続したい、
となるときも同じような感じでしょうか
On Wed, 10 Aug 2011 15:05:24 +0900
Yui NARUSE <naruse@airemix.jp> wrote:
>
> Issue #5180 has been updated by Yui NARUSE.
>
>
> Shyouhei Urabe wrote:
> > (08/10/2011 11:46 AM), Yui NARUSE wrote:
> > > 例えば、ホスト名は "ruby-lang.org" としたいが、IP アドレスは 127.0.0.1 とか。
> >
> > /etc/hostsを書け、ではだめですか。名前解決のレイヤーの要件をHTTPで解決するのは筋が悪いでしょう。
>
> 127.0.0.1 の例だとそうなんですね。
>
> 別のユースケースとして、同じホスト名(というかドメイン名)を持つ複数のサーバ群に対して、
> それぞれに動作確認で通信したい事があったんですが、この場合だと一定のホスト名を送りつつ 、
> IP アドレスは網羅しないといけないので、/etc/hosts だとサーバーの数だけ書き換えて試すのを
> 繰り返さないといけないのでつらいです。
> ----------------------------------------
> Feature #5180: net/http の接続時に用いる IP アドレスの指定
> http://redmine.ruby-lang.org/issues/5180
>
> Author: Yui NARUSE
> Status: Open
> Priority: Normal
> Assignee:
> Category: lib
> Target version:
>
>
> 通常 net/http を使う時は、Net::HTTP.start("ruby-lang.org") などとホスト名を使います。
> で、Socket がホスト名から IP アドレスを引いて、コネクションが張られます。
> 普通の人はこれで足りるわけですが、ふつうな人はしばしば DNS で引けない IP アドレスに接続したくなります。
> 例えば、ホスト名は "ruby-lang.org" としたいが、IP アドレスは 127.0.0.1 とか。
>
> 以下のパッチをあてると、
> Net::HTTP.start("ruby-lang.org", ipaddr: '127.0.0.1')
> などとできるようになります。
>
> diff --git a/lib/net/http.rb b/lib/net/http.rb
> index 7b9ec4f..6d034e0 100644
> --- a/lib/net/http.rb
> +++ b/lib/net/http.rb
> @@ -524,7 +524,7 @@ module Net #:nodoc:
> # _opt_ :: optional hash
> #
> # _opt_ sets following values by its accessor.
> - # The keys are ca_file, ca_path, cert, cert_store, ciphers,
> + # The keys are ipaddr, ca_file, ca_path, cert, cert_store, ciphers,
> # close_on_empty_response, key, open_timeout, read_timeout, ssl_timeout,
> # ssl_version, use_ssl, verify_callback, verify_depth and verify_mode.
> # If you set :use_ssl as true, you can use https and default value of
> @@ -542,6 +542,7 @@ module Net #:nodoc:
> port, p_addr, p_port, p_user, p_pass = *arg
> port = https_default_port if !port && opt && opt[:use_ssl]
> http = new(address, port, p_addr, p_port, p_user, p_pass)
> + http.ipaddr = opt[:ipaddr] if opt[:ipaddr]
>
> if opt
> if opt[:use_ssl]
> @@ -575,6 +576,7 @@ module Net #:nodoc:
> def initialize(address, port = nil)
> @address = address
> @port = (port || HTTP.default_port)
> + @ipaddr = nil
> @curr_http_version = HTTPVersion
> @no_keepalive_server = false
> @close_on_empty_response = false
> @@ -620,6 +622,17 @@ module Net #:nodoc:
> # The port number to connect to.
> attr_reader :port
>
> + # The IP address to connect to/used to connect to
> + def ipaddr
> + started? ? @socket.io.peeraddr[3] : @ipaddr
> + end
> +
> + # Set the IP address to connect to
> + def ipaddr=(addr)
> + raise IOError, "ipaddr value changed, but session already started" if started?
> + @ipaddr = addr
> + end
> +
> # Number of seconds to wait for the connection to open. Any number
> # may be used, including Floats for fractional seconds. If the HTTP
> # object cannot open a connection in this many seconds, it raises a
> @@ -945,7 +958,7 @@ module Net #:nodoc:
> # without proxy
>
> def conn_address
> - address()
> + @ipaddr || address()
> end
>
> def conn_port
>
>
> --
> http://redmine.ruby-lang.org