24件ヒット
[1-24件を表示]
(0.132秒)
検索結果
先頭2件
-
WEBrick
:: HTTPProxyServer (30006.0) -
プロクシの機能を提供するクラスです。CONNECT メソッドにも対応しています。
...ECT メソッドにも対応しています。
* 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... -
WEBrick
:: HTTPProxyServer . new(config , default = WEBrick :: Config :: HTTP) -> WEBrick :: HTTPProxyServer (9456.0) -
プロクシオブジェクトを生成して返します。
...は WEBrick::HTTPServer.new と同じです。
それに加えて以下のキーが有効です。
: :ProxyAuthProc
プロクシ認証を行う Proc オブジェクトを指定します。この proc は
WEBrick::HTTPResponse オブジェクトと WEBrick::HTTPRequest オブジェ......です。通常は 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)
//}
: :ProxyContentHandler
接続先の HTTP サーバからの内容を処理する Proc オブジェクトを指定します。...