44件ヒット
[1-44件を表示]
(0.085秒)
検索結果
先頭4件
-
WEBrick
:: HTTPProxyServer . new(config , default = WEBrick :: Config :: HTTP) -> WEBrick :: HTTPProxyServer (3314.0) -
プロクシオブジェクトを生成して返します。
...プロクシオブジェクトを生成して返します。
@param config 設定を保存したハッシュを指定します。
設定として有効なハッシュのキーとその値は WEBrick::HTTPServer.new と同じです。
それに加えて以下のキーが......けません。nil を指定した場合すべての接続を
受け付けます。デフォルトは nil です。通常は WEBrick::HTTPAuth::ProxyBasicAuth か
WEBrick::HTTPAuth::ProxyDigestAuth を使用します。
//emlist{
require 'webrick'
require 'webrick/httpproxy'
auth_proc = proc{......|req, res|
unless c = req['proxy-authorization']
res['Proxy-Authenticate'] = 'Basic realm="WEBrick Proxy"'
raise WEBrick::HTTPStatus::ProxyAuthenticationRequired
else
# 略
end
}
s = WEBrick::HTTPProxyServer.new(ProxyAuthProc: auth_proc, Port: 8080)
//}
: :ProxyContentHandl... -
WEBrick
:: NullReader . gets(*args) -> nil (3202.0) -
常に nil を返します。
...常に nil を返します。... -
WEBrick
:: NullReader . read(*args) -> nil (3202.0) -
常に nil を返します。
...常に nil を返します。... -
WEBrick
:: HTTPProxyServer (3008.0) -
プロクシの機能を提供するクラスです。CONNECT メソッドにも対応しています。
...ています。
* https://magazine.rubyist.net/articles/0002/0002-WEBrickProxy.html
以下は完全に動作するプロクシサーバの例です。
require 'webrick'
require 'webrick/httpproxy'
s = WEBrick::HTTPProxyServer.new(Port: 8080)
Signal.trap('INT') do
s.shutdown
end
s.start...