Class: Libevent::Http
- Inherits:
-
Object
- Object
- Libevent::Http
- Defined in:
- lib/libevent/http.rb,
ext/libevent_ext/http.c
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
Instance Method Summary collapse
- #add_virtual_host ⇒ Object
- #bind_socket ⇒ Object
-
#handler(&block) ⇒ Object
Set request handler for current http instance.
- #initialize ⇒ Object constructor
- #set_request_handler ⇒ Object
- #set_timeout ⇒ Object
-
#vhost(domain) {|http| ... } ⇒ Http
Create virtual http server.
Constructor Details
#initialize ⇒ Object
7 |
# File 'ext/libevent_ext/http.c', line 7
static VALUE t_initialize(VALUE self, VALUE object);
|
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
4 5 6 |
# File 'lib/libevent/http.rb', line 4 def base @base end |
Instance Method Details
#add_virtual_host ⇒ Object
17 |
# File 'ext/libevent_ext/http.c', line 17
static VALUE t_add_virtual_host(VALUE self, VALUE domain, VALUE vhttp);
|
#bind_socket ⇒ Object
9 |
# File 'ext/libevent_ext/http.c', line 9
static VALUE t_bind_socket(VALUE self, VALUE address, VALUE port);
|
#handler(&block) ⇒ Object
Set request handler for current http instance
18 19 20 |
# File 'lib/libevent/http.rb', line 18 def handler(&block) set_request_handler(block) end |
#set_request_handler ⇒ Object
11 |
# File 'ext/libevent_ext/http.c', line 11
static VALUE t_set_request_handler(VALUE self, VALUE handler);
|
#set_timeout ⇒ Object
13 |
# File 'ext/libevent_ext/http.c', line 13
static VALUE t_set_timeout(VALUE self, VALUE timeout);
|
#vhost(domain) {|http| ... } ⇒ Http
Create virtual http server
9 10 11 12 13 14 |
# File 'lib/libevent/http.rb', line 9 def vhost(domain) http = self.class.new(self.base) add_virtual_host(domain, http) yield(http) if block_given? http end |