File size: 1,242 Bytes
7dca0de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/3proxy
config /etc/3proxy/3proxy.cfg

# you may use system to execute some external command if proxy starts
system "echo `which 3proxy`': Starting 3proxy'"

# We can configure nservers to avoid unsafe gethostbyname() usage (max 5 servers)
{{#name_servers}}
nserver {{ . }}
{{/name_servers}}

# nscache is good to save speed, traffic and bandwidth
nscache {{ name_servers_cache }}

# Here we can change timeout values
timeouts 1 5 30 60 180 1800 15 60

# Logging docs: <https://3proxy.org/doc/howtor.html#LOGFORMAT>
log {{ log.output }}
logformat "-\""+_G{""time_unix"":%t, ""proxy"":{""type:"":""%N"", ""port"":%p}, ""error"":{""code"":""%E""}, ""auth"":{""user"":""%U""}, ""client"":{""ip"":""%C"", ""port"":%c}, ""server"":{""ip"":""%R"", ""port"":%r}, ""bytes"":{""sent"":%O, ""received"":%I}, ""request"":{""hostname"":""%n""}, ""message"":""%T""}"

maxconn {{ max_connections }}

{{^auth.login=}}{{^auth.password=}}
users {{ auth.login }}:CL:{{ auth.password }}{{#auth.extra_accounts.*}} {{ * }}:CL:{{ . }}{{/auth.extra_accounts.*}}
auth strong
allow {{ auth.login }}{{#auth.extra_accounts.*}},{{ * }}{{/auth.extra_accounts.*}}
{{/auth.password=}}{{/auth.login=}}

proxy -a -p{{ ports.proxy }}
socks -a -p{{ ports.socks }}

flush