るりまサーチ

最速Rubyリファレンスマニュアル検索!
670件ヒット [1-100件を表示] (0.023秒)

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 ... > >>

Net::HTTP.Proxy(address, port = 80) -> Class (18189.0)

Proxy 経由で http サーバに接続するためのクラスを作成し返します。

...
Proxy
経由で http サーバに接続するためのクラスを作成し返します。

このクラスは Net::HTTP を継承しているので Net::HTTP と全く
同じように使えます。指定されたプロクシを常に経由して http サーバ
に接続します。

address が n...
...][ruby]{
require
'net/http'
proxy
_class = Net::HTTP::Proxy('proxy.example.com', 8080)
http = proxy_class.new('www.example.org')
http.start {|h|
h.get('/ja/') # proxy.example.com 経由で接続します。
}
//}

//emlist[例2: Net::HTTP.start を使う][ruby]{
require
'net/http'
proxy
_class = Net...
...::HTTP::Proxy('proxy.example.com', 8080)
proxy
_class.start('www.example.org') {|h|
h.get('/ja/') # proxy.example.com 経由で接続します。
}
//}

@param address プロクシのホスト名を文字列で与えます。
@param port プロクシのポート番号を与えます。...

Net::HTTPProxyAuthenticationRequired (12016.0)

HTTP レスポンス 407 (Proxy Authentication Required) を表現するクラスです。

...HTTP レスポンス 407 (Proxy Authentication Required) を表現するクラスです。

詳しくは 7235 Section 3.2 を見てください。...

WEBrick::HTTPStatus::ProxyAuthenticationRequired (12016.0)

HTTP のステータスコード 407 Proxy Authentication Required を表すクラスです。

...HTTP のステータスコード 407 Proxy Authentication Required を表すクラスです。...

WEBrick::HTTPStatus::RC_PROXY_AUTHENTICATION_REQUIRED (6208.0)

HTTP のステータスコードを表す整数です。

...HTTP のステータスコードを表す整数です。

require
'webrick'
p WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR #=> 500...

Net::HTTPHeader#proxy_basic_auth(account, password) -> [String] (6145.0)

Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

...
Proxy
認証のために Proxy-Authorization: ヘッダをセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

//emlist[例][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html...
...')
req = Net::HTTP::Get.new(uri.request_uri)
req.proxy_basic_auth("account", "password") # => ["Basic YWNjb3VudDpwYXNzd29yZA=="]
//}...

絞り込み条件を変える

WEBrick::HTTPProxyServer (6012.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 (3166.0)

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

...ッシュのキーとその値は WEBrick::HTTPServer.new と同じです。
それに加えて以下のキーが有効です。

: :ProxyAuthProc
プロクシ認証を行う Proc オブジェクトを指定します。この proc は
WEBrick::HTTPResponse オブジェクトと WEB...
...Brick::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 WEB...
...rick::HTTPStatus::ProxyAuthenticationRequired
else
# 略
end
}
s = WEBrick::HTTPProxyServer.new(ProxyAuthProc: auth_proc, Port: 8080)
//}
: :ProxyContentHandler
接続先の HTTP サーバからの内容を処理する Proc オブジェクトを指定します。
レスポンスの...

WEBrick::HTTPStatus::RC_LENGTH_REQUIRED (3108.0)

HTTP のステータスコードを表す整数です。

...HTTP のステータスコードを表す整数です。

require
'webrick'
p WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR #=> 500...

WEBrick::HTTPStatus::RC_PAYMENT_REQUIRED (3108.0)

HTTP のステータスコードを表す整数です。

...HTTP のステータスコードを表す整数です。

require
'webrick'
p WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR #=> 500...
<< 1 2 3 ... > >>