36件ヒット
[1-36件を表示]
(0.040秒)
別のキーワード
検索結果
先頭3件
-
webrick
/ httpproxy (44000.0) -
プロクシの機能を提供するライブラリです。CONNECT メソッドにも対応しています。
プロクシの機能を提供するライブラリです。CONNECT メソッドにも対応しています。 -
WEBrick
:: HTTPProxyServer (14006.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... -
WEBrick
:: HTTPProxyServer . new(config , default = WEBrick :: Config :: HTTP) -> WEBrick :: HTTPProxyServer (11118.0) -
プロクシオブジェクトを生成して返します。
...'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(Proxy......ォルトは nil です。
//emlist{
require 'webrick'
require 'webrick/httpproxy'
handler = proc{|req, res|
res.body.gsub!(/です。/, 'でんがな。')
res.body.gsub!(/ます。/, 'まんがな。')
}
s = WEBrick::HTTPProxyServer.new(ProxyContentHandler: handler, Port: 8080)
//}
: :Pr......その Proxy の URI
を URI オブジェクトで指定します。
//emlist{
require 'uri'
require 'webrick/httpproxy'
u = URI.parse('http://localhost:18080/')
s = WEBrick::HTTPProxyServer.new(ProxyURI: u, Port: 8080)
//}
@param default デフォルトは WEBrick::Config::HTTP です。...