rhaproxy 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changelog +0 -0
- data/MIT-LICENSE +21 -0
- data/README +58 -0
- data/lib/rhaproxy/backend.rb +5014 -0
- data/lib/rhaproxy/defaults.rb +3713 -0
- data/lib/rhaproxy/frontend.rb +3251 -0
- data/lib/rhaproxy/global.rb +590 -0
- data/lib/rhaproxy/listen.rb +6090 -0
- data/lib/rhaproxy/peers.rb +110 -0
- data/lib/rhaproxy/userlist.rb +93 -0
- data/lib/rhaproxy/version.rb +17 -0
- data/lib/rhaproxy.rb +9 -0
- data/setup.rb +1585 -0
- data/test/test_helper.rb +2 -0
- data/test/test_rhaproxy.rb +11 -0
- metadata +81 -0
data/Changelog
ADDED
File without changes
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2011 Joel Bryan Juliano <joelbryan.juliano@gmail.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
README for Rhaproxy
|
2
|
+
==================
|
3
|
+
|
4
|
+
Rhaproxy is a gem providing a ruby interface to HAproxy TCP/HTTP Load Balancer.
|
5
|
+
|
6
|
+
To install, type 'gem install rhaproxy'
|
7
|
+
|
8
|
+
Usage:
|
9
|
+
|
10
|
+
require 'rubygems'
|
11
|
+
require 'rhaproxy'
|
12
|
+
|
13
|
+
global = RhaproxyGlobal.new
|
14
|
+
global.daemon = true
|
15
|
+
global.maxconn = 256
|
16
|
+
|
17
|
+
defaults = RhaproxyDefaults.new
|
18
|
+
defaults.mode = "http"
|
19
|
+
defaults.timeout_connect = "5000ms"
|
20
|
+
defaults.timeout_client = "50000ms"
|
21
|
+
defaults.timeout_server = "50000ms"
|
22
|
+
|
23
|
+
frontend = RhaproxyFrontend.new
|
24
|
+
frontend.name = "http-in"
|
25
|
+
frontend.default_backend = "servers"
|
26
|
+
|
27
|
+
backend = RhaproxyBackend.new
|
28
|
+
backend.name = "servers"
|
29
|
+
backend.server = "server1 127.0.0.1:8000 maxconn 32"
|
30
|
+
|
31
|
+
config = Array.new
|
32
|
+
config.push([global.config])
|
33
|
+
config.push([defaults.config])
|
34
|
+
config.push([frontend.config])
|
35
|
+
config.push([backend.config])
|
36
|
+
|
37
|
+
haproxy_conf_file = File.new("haproxy.conf", "w+")
|
38
|
+
haproxy_conf_file.puts(config)
|
39
|
+
haproxy_conf_file.close
|
40
|
+
|
41
|
+
haproxy.conf:
|
42
|
+
|
43
|
+
global
|
44
|
+
daemon
|
45
|
+
maxconn 256
|
46
|
+
|
47
|
+
defaults
|
48
|
+
mode http
|
49
|
+
timeout client 50000ms
|
50
|
+
timeout connect 5000ms
|
51
|
+
timeout server 50000ms
|
52
|
+
|
53
|
+
frontend http-in
|
54
|
+
default_backend servers
|
55
|
+
|
56
|
+
backend servers
|
57
|
+
server server1 127.0.0.1:8000 maxconn 32
|
58
|
+
|