Module: ExperellaProxy
- Defined in:
- lib/experella-proxy.rb,
lib/experella-proxy/proxy.rb,
lib/experella-proxy/server.rb,
lib/experella-proxy/backend.rb,
lib/experella-proxy/globals.rb,
lib/experella-proxy/request.rb,
lib/experella-proxy/version.rb,
lib/experella-proxy/response.rb,
lib/experella-proxy/connection.rb,
lib/experella-proxy/configuration.rb,
lib/experella-proxy/backend_server.rb,
lib/experella-proxy/http_status_codes.rb,
lib/experella-proxy/connection_manager.rb
Overview
Namespace Module for the Proxy Server
Startup code and options parser is defined here
Defined Under Namespace
Modules: Globals Classes: Backend, BackendServer, Configuration, Connection, ConnectionManager, Proxy, Request, Response, Server
Constant Summary collapse
- HOP_HEADERS =
defined hop by hop header fields
%w(Connection Keep-Alive Proxy-Authorization TE Trailer Transfer-Encoding Upgrade)
- VERSION =
ExperellaProxy Gemversion 0.0.14
-
added error handling for unknown http status codes
0.0.13
* headers are no longer folded if they came unfolded but headers stay as is0.0.12.WIP
* rubocop cleanup0.0.11
-
output version on start
-
rubocup config file
-
applied rubyocop config file
0.0.10
-
no logging any more just firing events
0.0.9
-
added simplecov code coverage support.
-
removed an unescaped duplicate debug log output
0.0.8
-
fixed a parsing bug where no data was send when backend used connection close to indicate message end
0.0.7
-
fixed minor issues with ruby 2.0
-
fixed a typo in default config
-
refactored mangling in own method
-
refactored message pattern and matching
0.0.6
-
updated homepage
0.0.5
-
added :host_port option to backend configuration
0.0.4
-
added lambda for accept filtering
0.0.3
-
added self-signed SSL certificate for TLS/HTTPS
-
added config template init functionality
-
"0.0.14"- HTTP_STATUS_CODES =
Every standard HTTP code mapped to the appropriate message.
{ 100 => 'Continue', 101 => 'Switching Protocols', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Moved Temporarily', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 422 => 'Unprocessable Entity', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported', 522 => 'Uknown Error' }
Class Method Summary collapse
-
.config ⇒ Configuration
static getter for the config variable.
-
.config=(config) ⇒ Configuration
static setter for the config variable.
-
.connection_manager ⇒ ConnectionManager
static getter for the connection_manager variable.
-
.init(options = {}) ⇒ Boolean
Initializes ExperellaProxy’s Configuration and ConnectionManager.
-
.restart ⇒ Object
Fresh restarts ExperellaProxy with same options.
-
.run(options = {}) ⇒ Object
Creates Server object and calls Server#run if ExperellaProxy.init.
-
.stop ⇒ Object
Stops ExperellaProxy.
Class Method Details
.config ⇒ Configuration
static getter for the config variable
5 6 7 |
# File 'lib/experella-proxy/configuration.rb', line 5 def self.config @config end |
.config=(config) ⇒ Configuration
static setter for the config variable
13 14 15 |
# File 'lib/experella-proxy/configuration.rb', line 13 def self.config=(config) @config = config end |
.connection_manager ⇒ ConnectionManager
static getter for the connection_manager variable
5 6 7 |
# File 'lib/experella-proxy/connection_manager.rb', line 5 def self.connection_manager @connection_manager end |
.init(options = {}) ⇒ Boolean
Initializes ExperellaProxy’s Configuration and ConnectionManager
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/experella-proxy.rb', line 44 def self.init(={}) begin Configuration.new() rescue Configuration::NoConfigError => e puts e. puts e.backtrace.join("\n\t") return false end @connection_manager = ConnectionManager.new true end |
.restart ⇒ Object
Fresh restarts ExperellaProxy with same options.
Loses all buffered data
67 68 69 70 71 |
# File 'lib/experella-proxy.rb', line 67 def self.restart opts = @server. stop Server.new(opts).run if ExperellaProxy.init(opts) end |
.run(options = {}) ⇒ Object
Creates Server object and calls ExperellaProxy::Server#run if init
60 61 62 |
# File 'lib/experella-proxy.rb', line 60 def self.run(={}) @server = Server.new().run if ExperellaProxy.init() end |