OSDN Git Service

ruby-1.9.1-rc1
[splhack/AndroidRuby.git] / lib / ruby-1.9.1-rc1 / lib / webrick / config.rb
1 #
2 # config.rb -- Default configurations.
3 #
4 # Author: IPR -- Internet Programming with Ruby -- writers
5 # Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
6 # Copyright (c) 2003 Internet Programming with Ruby writers. All rights
7 # reserved.
8 #
9 # $IPR: config.rb,v 1.52 2003/07/22 19:20:42 gotoyuzo Exp $
10
11 require 'webrick/version'
12 require 'webrick/httpversion'
13 require 'webrick/httputils'
14 require 'webrick/utils'
15 require 'webrick/log'
16
17 module WEBrick
18   module Config
19     LIBDIR = File::dirname(__FILE__)
20
21     # for GenericServer
22     General = {
23       :ServerName     => Utils::getservername,
24       :BindAddress    => nil,   # "0.0.0.0" or "::" or nil
25       :Port           => nil,   # users MUST specifiy this!!
26       :MaxClients     => 100,   # maximum number of the concurrent connections
27       :ServerType     => nil,   # default: WEBrick::SimpleServer
28       :Logger         => nil,   # default: WEBrick::Log.new
29       :ServerSoftware => "WEBrick/#{WEBrick::VERSION} " +
30                          "(Ruby/#{RUBY_VERSION}/#{RUBY_RELEASE_DATE})",
31       :TempDir        => ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp',
32       :DoNotListen    => false,
33       :StartCallback  => nil,
34       :StopCallback   => nil,
35       :AcceptCallback => nil,
36       :DoNotReverseLookup => nil,
37       :ShutdownSocketWithoutClose => false,
38     }
39
40     # for HTTPServer, HTTPRequest, HTTPResponse ...
41     HTTP = General.dup.update(
42       :Port           => 80,
43       :RequestTimeout => 30,
44       :HTTPVersion    => HTTPVersion.new("1.1"),
45       :AccessLog      => nil,
46       :MimeTypes      => HTTPUtils::DefaultMimeTypes,
47       :DirectoryIndex => ["index.html","index.htm","index.cgi","index.rhtml"],
48       :DocumentRoot   => nil,
49       :DocumentRootOptions => { :FancyIndexing => true },
50       :RequestCallback => nil,
51       :ServerAlias    => nil,
52       :InputBufferSize  => 65536, # input buffer size in reading request body
53       :OutputBufferSize => 65536, # output buffer size in sending File or IO
54
55       # for HTTPProxyServer
56       :ProxyAuthProc  => nil,
57       :ProxyContentHandler => nil,
58       :ProxyVia       => true,
59       :ProxyTimeout   => true,
60       :ProxyURI       => nil,
61
62       :CGIInterpreter => nil,
63       :CGIPathEnv     => nil,
64
65       # workaround: if Request-URIs contain 8bit chars,
66       # they should be escaped before calling of URI::parse().
67       :Escape8bitURI  => false
68     )
69
70     FileHandler = {
71       :NondisclosureName => [".ht*", "*~"],
72       :FancyIndexing     => false,
73       :HandlerTable      => {},
74       :HandlerCallback   => nil,
75       :DirectoryCallback => nil,
76       :FileCallback      => nil,
77       :UserDir           => nil,  # e.g. "public_html"
78       :AcceptableLanguages => []  # ["en", "ja", ... ]
79     }
80
81     BasicAuth = {
82       :AutoReloadUserDB     => true,
83     }
84
85     DigestAuth = {
86       :Algorithm            => 'MD5-sess', # or 'MD5' 
87       :Domain               => nil,        # an array includes domain names.
88       :Qop                  => [ 'auth' ], # 'auth' or 'auth-int' or both.
89       :UseOpaque            => true,
90       :UseNextNonce         => false,
91       :CheckNc              => false,
92       :UseAuthenticationInfoHeader => true,
93       :AutoReloadUserDB     => true,
94       :NonceExpirePeriod    => 30*60,
95       :NonceExpireDelta     => 60,
96       :InternetExplorerHack => true,
97       :OperaHack            => true,
98     }
99   end
100 end