forked from zet4/alpine-tor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhaproxy.cfg.erb
50 lines (42 loc) · 909 Bytes
/
haproxy.cfg.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
global
daemon
user root
group root
pidfile <%= pid_file %>
defaults
mode http
maxconn 50000
timeout client 3600s
timeout connect 1s
timeout queue 5s
timeout server 3600s
listen stats
bind *:<%= stats %>
mode http
stats enable
stats uri /
stats auth <%= login %>:<%= pass %>
listen TOR-in-socks
bind *:<%= port_socks %>
mode tcp
default_backend TORSocks
balance roundrobin
listen TOR-in-http
bind *:<%= port_http %>
mode tcp
default_backend TORHTTP
balance roundrobin
backend TORSocks
mode tcp
<% backends.each do |b| %>
<% if b[:name] == 'tor_socks' %>
server <%= b[:addr] %>:<%= b[:port] %> <%= b[:addr] %>:<%= b[:port] %> check
<% end %>
<% end %>
backend TORHTTP
mode tcp
<% backends.each do |b| %>
<% if b[:name] == 'tor_http' %>
server <%= b[:addr] %>:<%= b[:port] %> <%= b[:addr] %>:<%= b[:port] %> check
<% end %>
<% end %>