Spaces:
Build error
Build error
| #!/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 | |