るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.010秒)
トップページ > クエリ:HTTPProxyServer[x]

別のキーワード

  1. httpproxyserver new
  2. webrick/httpproxy httpproxyserver
  3. webrick/httpproxy webrick::httpproxyserver
  4. httpproxyserver
  5. new webrick::httpproxyserver

種類

ライブラリ

クラス

検索結果

WEBrick::HTTPProxyServer (18006.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 (3119.0)

プロクシオブジェクトを生成して返します。

...icate'] = 'Basic realm="WEBrick Proxy"'
raise WEBrick::HTTPStatus::ProxyAuthenticationRequired
else
# 略
end
}
s = WEBrick::HTTPProxyServer.new(ProxyAuthProc: auth_proc, Port: 8080)
//}
: :ProxyContentHandler
接続先の HTTP サーバからの内容を処理する Proc オブ...
...handler = proc{|req, res|
res.body.gsub!(/です。/, 'でんがな。')
res.body.gsub!(/ます。/, 'まんがな。')
}
s = WEBrick::HTTPProxyServer.new(ProxyContentHandler: handler, Port: 8080)
//}
: :ProxyVia
true を指定した場合 接続先の HTTP サーバへのリクエスト...
...の 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 です。...