るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

WEBrick::HTTPAuth::BasicAuth (18012.0)

HTTP の Basic 認証のためのクラスです。

....new('dot.htpasswd')
htpd.set_passwd(nil, 'username', 'supersecretpass')

authenticator = WEBrick::HTTPAuth::BasicAuth.new(:UserDB => htpd, :Realm => realm)
srv.mount_proc('/basic_auth') {|req, res|
authenticator.authenticate(req, res)
res.body = "hoge"
}
srv.start #...