require 'webrick'
require "socket"
require "webrick/ssl"
#$localip = IPSocket::getaddress(Socket::gethostname)
srv = WEBrick::HTTPServer.new( {
:ServerName => "Server", # WEBrick::Utils.getservername
:BindAddress => $localip || "127.0.0.1" ,
:Port => 80,
:MaxClients => 100, # maximum number of the concurrent connections
:ServerType => nil, # default: WEBrick::SimpleServer
:Logger => nil, # default: WEBrick::Log.new
:ServerSoftware => "WEBrick/#{WEBrick::VERSION} " +
"(Ruby/#{RUBY_VERSION}/#{RUBY_RELEASE_DATE})",
:TempDir => ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp',
:DoNotListen => false,
:StartCallback => nil,
:StopCallback => nil,
:AcceptCallback => nil,
:DoNotReverseLookup => nil,
:RequestTimeout => 30,
# :HTTPVersion => HTTPVersion.new("1.1"),
:AccessLog => nil,
:MimeTypes => WEBrick::HTTPUtils::DefaultMimeTypes,
:DirectoryIndex => [ "index.cgi" ,"index.html","index.htm","index.rhtml"],
:DocumentRoot => "./",
:DocumentRootOptions => { :FancyIndexing => true },
:RequestCallback => nil,
:ServerAlias => nil,
:CGIInterpreter => 'C:\ruby193\bin\ruby.exe',
:CGIPathEnv => nil,
# workaround: if Request-URIs contain 8bit chars,
# they should be escaped before calling of URI.parse().
:Escape8bitURI => false
# :SSLEnable => true
})
# trap('INT') { server.shutdown }
srv.start
cmVxdWlyZSAnd2VicmljaycKcmVxdWlyZSAic29ja2V0IiAKcmVxdWlyZSAid2Vicmljay9zc2wiCgojJGxvY2FsaXAgPSBJUFNvY2tldDo6Z2V0YWRkcmVzcyhTb2NrZXQ6OmdldGhvc3RuYW1lKSAKCnNydiA9IFdFQnJpY2s6OkhUVFBTZXJ2ZXIubmV3KCB7CiAgOlNlcnZlck5hbWUgICAgID0+ICJTZXJ2ZXIiLCAjIFdFQnJpY2s6OlV0aWxzLmdldHNlcnZlcm5hbWUKICA6QmluZEFkZHJlc3MgICAgPT4gJGxvY2FsaXAgfHwgIjEyNy4wLjAuMSIgLAogIDpQ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