#!/usr/local/bin/3proxy
# Yes, 3proxy.cfg can be executable, in this case you should place
# something like
#config /usr/local/3proxy/3proxy.cfg
# to show which configuration 3proxy should re-read on realod.
system "echo 3proxy is running...!"
# you may use system to execute some external command if proxy starts
# We can configure nservers to avoid unsafe gethostbyname() usage
####! maybe useful, but dont understand
#nserver 10.1.2.1
#nserver 10.2.2.2
# nscache is good to save speed, traffic and bandwidth
nscache 65536
# in log file we want to have underscores instead of spaces
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
rotate 30
# We will keep last 30 log files
internal 192.168.56.101
# internal is address of interface proxy will listen for incoming requests
# 127.0.0.1 means only localhost will be able to use this proxy. This is
# address you should specify for clients as proxy IP.
# You MAY use 0.0.0.0 but you shouldn't, because it's a chance for you to
# have open proxy in your network in this case.
auth none
# no authentication is requires
####! maybe useful in some occassions
# dnspr
# dnsproxy listens on UDP/53 to answer client's DNS requests. It requires
# nserver/nscache configuration.
#external $./external.ip
#internal $./internal.ip
# this is just an alternative form fo giving external and internal address
# allows you to read this addresses from files
auth none
# We want to protect internal interface
deny * * 127.0.0.1,192.168.56.101
# and llow HTTP and HTTPS traffic.
allow * * * 80-88,8080-8088 HTTP
allow * * * 443,8443 HTTPS
proxy -n -p8090
auth none
flush
socks -p9080
@echo off
echo Simple script to keep a program running all the time
set program_path=C:\NAT32\nat32.exe 2
set program_name=NAT32
set count=0
set wait_seconds=30
:LOOP
set /A count=%count%+1
echo "start %program_name% for %count% time(s)"
rem - wait it terminates
start /wait %program_path%
echo "ooooops, it stops..."
echo "wait for about %wait_seconds% seconds, then restart..."
rem - wait for several seconds
@ping 127.0.0.1 -n %wait_seconds% -w 1000 > nul
@ping 127.0.0.1 -n %1% -w 1000> nul
echo ...
echo ================================================================
rem - to restart an infinite loop
rem - of course, you can use a for loop to make it run limited times
goto LOOP