[#42851] Object#define_singleton_method がない?? — take_tk <ggb03124@...>

たけ(tk)です

14 messages 2006/10/06
[#42852] Re: Object#define_singleton_method がない?? — Yukihiro Matsumoto <matz@...> 2006/10/06

まつもと ゆきひろです

[#42853] Re: Object#define_singleton_method がない?? — take_tk <ggb03124@...> 2006/10/06

たけ(tk)です。

[#42870] system の実行タイミングのトラブル — "Hideo Konami" <konami@...>

小波です。

18 messages 2006/10/14
[#42874] Re: system の実行タイミングのトラブル — "Hideo Konami" <konami@...> 2006/10/14

小波です。

[#42876] Re: system の実行タイミングのトラブル — cuzic <cuzic@...> 2006/10/14

cuzic です。

[#42885] apt-listbugs: soap4r での悩み — Junichi Uekawa <dancer@...>

ruby-list のみなさま、

21 messages 2006/10/16
[#42891] Re: apt-listbugs: soap4r での悩み — "NAKAMURA, Hiroshi" <nakahiro@...> 2006/10/17

-----BEGIN PGP SIGNED MESSAGE-----

[#42892] Re: apt-listbugs: soap4r での悩み — Junichi Uekawa <dancer@...> 2006/10/17

こんにちは、

[#42896] Re: apt-listbugs: soap4r での悩み — "NAKAMURA, Hiroshi" <nakahiro@...> 2006/10/17

-----BEGIN PGP SIGNED MESSAGE-----

[#42929] Re: 括弧なしsuperで引数が引き継がれない — "U.Nakamura" <usa@...>

こんにちは、なかむら(う)です。

17 messages 2006/10/31
[#42930] Re: 括弧なしsuperで引数が引き継がれない — "U.Nakamura" <usa@...> 2006/10/31

こんにちは、なかむら(う)です。

[#42931] instant rails インストール! irbを起動するには? — "Uema Tsuyoshi" <mugenkai15@...> 2006/10/31

上間といいます。

[#42933] Re: instant rails インストール! irbを起動するには? — "きむらこういち" <hogemuta@...> 2006/10/31

木村です。

[#42937] Re: instant rails インストール! irbを起動するには? — "Uema Tsuyoshi" <mugenkai15@...> 2006/10/31

上間です。

[ruby-list:42912] Re: apt-listbugs: soap4r での悩み

From: Kouhei Sutou <kou@...>
Date: 2006-10-18 15:30:05 UTC
List: ruby-list #42912
須藤です.

すいません,[ruby-list:42911]のメールが壊れてしまいました.
# これも壊れたらどうしよう...

In <4534DCDB.5080405@sarion.co.jp>
  "[ruby-list:42896] Re: apt-listbugs: soap4r での悩み" on Tue, 17 Oct 2006 22:39:31 +0900,
  "NAKAMURA, Hiroshi" <nakahiro@sarion.co.jp> wrote:

> http-access2でproxy authenticationができるのがベストですね。検討してみま
> すが、身の回りで必要がないこともあり、実装には時間がかかるかもしれません。

手元で簡単に試した分ではこれで動きました.
他への影響は調べていません.

Attachments (1)

http-access2-proxy-authorization.diff (2.01 KB, text/x-diff)
--- http-access2.rb.orig	2006-10-19 00:19:04.000000000 +0900
+++ http-access2.rb	2006-10-19 00:20:10.000000000 +0900
@@ -170,8 +170,7 @@
       else
         @proxy = URI.parse(proxy)
       end
-      if @proxy.scheme == nil or @proxy.scheme.downcase != 'http' or
-	  @proxy.host == nil or @proxy.port == nil
+      if !@proxy.is_a?(URI::HTTP) or @proxy.host == nil or @proxy.port == nil
 	raise ArgumentError.new("unsupported proxy `#{proxy}'")
       end
     end
@@ -745,21 +744,33 @@
   attr_accessor :scheme
   attr_accessor :host
   attr_reader :port
+  attr_accessor :user
+  attr_accessor :password
 
   def initialize(uri = nil)
     if uri
       @scheme = uri.scheme
       @host = uri.host
       @port = uri.port.to_i
+      @user = uri.user
+      @password = uri.password
     else
       @scheme = 'tcp'
       @host = '0.0.0.0'
       @port = 0
+      @user = nil
+      @password = nil
     end
   end
 
   def addr
-    "#{@scheme}://#{@host}:#{@port.to_s}"
+    credential = ""
+    if @user
+      credential << @user
+      credential << ":XXX" if @password
+      credential << "@"
+    end
+    "#{@scheme}://#{credential}#{@host}:#{@port.to_s}"
   end
 
   def port=(port)
@@ -768,7 +779,9 @@
 
   def ==(rhs)
     if rhs.is_a?(Site)
-      ((@scheme == rhs.scheme) and (@host == rhs.host) and (@port == rhs.port))
+      ((@scheme == rhs.scheme) and (@host == rhs.host) and
+       (@port == rhs.port) and (@user == rhs.user) and
+       (@password == rhs.password))
     else
       false
     end
@@ -1402,7 +1415,13 @@
   end
 
   def connect_ssl_proxy(socket)
-    socket << sprintf("CONNECT %s:%s HTTP/1.1\r\n\r\n", @dest.host, @dest.port)
+    socket << sprintf("CONNECT %s:%s HTTP/1.1\r\n", @dest.host, @dest.port)
+    if @proxy.user
+      credential = ["#{@proxy.user}:#{@proxy.password}"].pack('m')
+      credential.delete!("\r\n")
+      socket << sprintf("Proxy-Authorization: Basic %s\r\n", credential)
+    end
+    socket << "\r\n"
     parse_header(socket)
     unless @status == 200
       raise BadResponse.new(

In This Thread