Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.217.130
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby19 /
share /
ri /
1.9.1 /
system /
WEBrick /
Delete
Unzip
Name
Size
Permission
Date
Action
AccessLog
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
BasicLog
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
CGI
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Config
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Cookie
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Daemon
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
FakeProxyURI
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
GenericServer
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTMLUtils
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPAuth
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPProxyServer
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPRequest
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPResponse
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPServer
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPServerError
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPServlet
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPStatus
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPUtils
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
HTTPVersion
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Log
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
NullReader
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
ServerError
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
SimpleServer
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Utils
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
cdesc-WEBrick.ri
7.73
KB
-rw-r--r--
2023-07-26 17:26
Save
Rename
U:RDoc::NormalModule[iI"WEBrick:EF@0o:RDoc::Markup::Document:@parts[o;;[lS:RDoc::Markup::Heading: leveli: textI"WEB server toolkit.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Paragraph;[ I"QWEBrick is an HTTP server toolkit that can be configured as an HTTPS server,;TI"Ja proxy server, and a virtual-host server. WEBrick features complete;TI"Nlogging of both server operations and HTTP access. WEBrick supports both;TI"Obasic and digest authentication in addition to algorithms not in RFC 2617.;T@o; ;[ I"QA WEBrick servers can be composed of multiple WEBrick servers or servlets to;TI"Iprovide differing behavior on a per-host or per-path basis. WEBrick;TI"Kincludes servlets for handling CGI scripts, ERb pages, ruby blocks and;TI"directory listings.;T@o; ;[I"QWEBrick also includes tools for daemonizing a process and starting a process;TI":at a higher privilege level and dropping permissions.;T@S; ; i;I"Starting an HTTP server;T@o; ;[I"PTo create a new WEBrick::HTTPServer that will listen to connections on port;TI"I8000 and serve documents from the current user's public_html folder:;T@o:RDoc::Markup::Verbatim;[ I"require 'webrick' ;FI" ;FI"-root = File.expand_path '~/public_html' ;FI"Kserver = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => root ;Fo; ;[I"KTo run the server you will need to provide a suitable shutdown hook as;TI"3starting the server blocks the current thread:;T@o;;[I"'trap 'INT' do server.shutdown end ;FI" ;FI"server.start ;FS; ; i;I"Custom Behavior;T@o; ;[ I"JThe easiest way to have a server perform custom operations is through;TI"KWEBrick::HTTPServer#mount_proc. The block given will be called with a;TI"MWEBrick::HTTPRequest with request info and a WEBrick::HTTPResponse which;TI"%must be filled in appropriately:;T@o;;[I")server.mount_proc '/' do |req, res| ;FI"" res.body = 'Hello, world!' ;FI" end ;Fo; ;[I"IRemember that <tt>server.mount_proc</tt> must <tt>server.start</tt>.;T@S; ; i;I" Servlets;T@o; ;[ I"LAdvanced custom behavior can be obtained through mounting a subclass of;TI"MWEBrick::HTTPServlet::AbstractServlet. Servlets provide more modularity;TI"Jwhen writing an HTTP server than mount_proc allows. Here is a simple;TI" servlet:;T@o;;[I":class Simple < WEBrick::HTTPServlet::AbstractServlet ;FI"$ def do_GET request, response ;FI"< status, content_type, body = do_stuff_with request ;FI" ;FI" response.status = 200 ;FI"1 response['Content-Type'] = 'text/plain' ;FI") response.body = 'Hello, World!' ;FI" end ;FI" end ;Fo; ;[I":To initialize the servlet you mount it on the server:;T@o;;[I"$server.mount '/simple', Simple ;Fo; ;[I"@See WEBrick::HTTPServlet::AbstractServlet for more details.;T@S; ; i;I"Virtual Hosts;T@o; ;[I"PA server can act as a virtual host for multiple host names. After creating;TI"Othe listening host, additional hosts that do not listen can be created and;TI"attached as virtual hosts:;T@o;;[I",server = WEBrick::HTTPServer.new # ... ;FI" ;FI"Evhost = WEBrick::HTTPServer.new :ServerName => 'vhost.example', ;FI"A :DoNotListen => true, # ... ;FI"vhost.mount '/', ... ;FI" ;FI"server.virtual_host vhost ;Fo; ;[I"RIf no +:DocumentRoot+ is provided and no servlets or procs are mounted on the;TI"1main server it will return 404 for all URLs.;T@S; ; i;I" HTTPS;T@o; ;[I"MTo create an HTTPS server you only need to enable SSL and provide an SSL;TI"certificate name:;T@o;;[I"require 'webrick' ;FI"require 'webrick/https' ;FI" ;FI"cert_name = [ ;FI" %w[CN localhost], ;FI"] ;FI" ;FI"5server = WEBrick::HTTPServer.new(:Port => 8000, ;FI": :SSLEnable => true, ;FI"A :SSLCertName => cert_name) ;Fo; ;[I"NThis will start the server with a self-generated self-signed certificate.;TI"HThe certificate will be changed every time the server is restarted.;T@o; ;[I"QTo create a server with a pre-determined key and certificate you can provide;TI" them:;T@o;;[I"require 'webrick' ;FI"require 'webrick/https' ;FI"require 'openssl' ;FI" ;FI"Icert = OpenSSL::X509::Certificate.new File.read '/path/to/cert.pem' ;FI"Apkey = OpenSSL::PKey::RSA.new File.read '/path/to/pkey.pem' ;FI" ;FI"5server = WEBrick::HTTPServer.new(:Port => 8000, ;FI": :SSLEnable => true, ;FI"? :SSLCertificate => cert, ;FI"> :SSLPrivateKey => pkey) ;FS; ; i;I"Proxy Server;T@o; ;[I"'WEBrick can act as a proxy server:;T@o;;[I"require 'webrick' ;FI"!require 'webrick/httpproxy' ;FI" ;FI"8proxy = WEBrick::HTTPProxyServer.new :Port => 8000 ;FI" ;FI"&trap 'INT' do proxy.shutdown end ;Fo; ;[I"AProxies may modifier the content of the response through the;TI"O+:ProxyContentHandler+ callback which will be invoked with the request and;TI"7respone after the remote content has been fetched.;T@S; ; i;I"$Basic and Digest authentication;T@o; ;[I"PWEBrick provides both Basic and Digest authentication for regular and proxy;TI"Fservers. See WEBrick::HTTPAuth, WEBrick::HTTPAuth::BasicAuth and;TI"#WEBrick::HTTPAuth::DigestAuth.;T@S; ; i;I"'WEBrick as a Production Web Server;T@o; ;[I"?WEBrick can be run as a production server for small loads.;T@S; ; i;I"Daemonizing;T@o; ;[I"KTo start a WEBrick server as a daemon simple run WEBrick::Daemon.start;TI" before starting the server.;T@S; ; i;I"Dropping Permissions;T@o; ;[I"PWEBrick can be started as one user to gain permission to bind to port 80 or;TI"N443 for serving HTTP or HTTPS traffic then can drop these permissions for;TI"Fregular operation. To listen on all interfaces for HTTP traffic:;T@o;;[I"7sockets = WEBrick::Utils.create_listeners nil, 80 ;Fo; ;[I"Then drop privileges:;T@o;;[I"WEBrick::Utils.su 'www' ;Fo; ;[I":Then create a server that does not listen by default:;T@o;;[I"Bserver = WEBrick::HTTPServer.new :DoNotListen => true, # ... ;Fo; ;[I"CThen overwrite the listening sockets with the port 80 sockets:;T@o;;[I"&server.listeners.replace sockets ;FS; ; i;I"Logging;T@o; ;[I"KWEBrick can separately log server operations and end-user access. For;TI"server operations:;T@o;;[I"7log_file = File.open '/var/log/webrick.log', 'a+' ;FI"%log = WEBrick::Log.new log_file ;Fo; ;[I"For user access logging:;T@o;;[ I"access_log = [ ;FI"< [log_file, WEBrick::AccessLog::COMBINED_LOG_FORMAT], ;FI"] ;FI" ;FI"Oserver = WEBrick::HTTPServer.new :Logger => log, :AccessLog => access_log ;Fo; ;[I"4See WEBrick::AccessLog for further log formats.;T@S; ; i;I"Log Rotation;T@o; ;[I"PTo rotate logs in WEBrick on a HUP signal (like syslogd can send), open the;TI"Llog file in 'a+' mode (as above) and trap 'HUP' to reopen the log file:;T@o;;[I"@trap 'HUP' do log_file.reopen '/path/to/webrick.log', 'a+' ;FS; ; i;I"Copyright;T@o; ;[I"=Author: IPR -- Internet Programming with Ruby -- writers;T@o; ;[I"9Copyright (c) 2000 TAKAHASHI Masayoshi, GOTOU YUUZOU;TI"JCopyright (c) 2002 Internet Programming with Ruby writers. All rights;TI"reserved.;T: @fileI"lib/webrick.rb;T;0[ [[I"NullReader;Fo;;[ ;0I"lib/webrick/httpproxy.rb;T[I"FakeProxyURI;Fo;;[ ;0@[I"VERSION;Fo;;[ ;0I"lib/webrick/version.rb;T[I"CR;Fo;;[ ;0I"lib/webrick/httputils.rb;T[I"LF;Fo;;[ ;0@[I" CRLF;Fo;;[ ;0@[ [[I" class;F[[:public[ [:protected[ [:private[ [I" instance;F[[;[ [;[ [;[