Go to file
wangchaofeng b52adf23f3 Merge branch 'master' into 'develop'
Master

See merge request mt-data/ipcenter!2
2019-03-14 14:31:15 +08:00
.gitignore v1.0.0 2018-12-17 02:58:52 +08:00
actives.yaml 新增昆明,福州,武汉,郑州,宁波,无锡,南京,石家庄,合肥,南昌 2019-02-28 10:03:58 +08:00
alertover.go v1.0.0 2018-12-17 02:58:52 +08:00
area.json 添加City Code 2018-12-17 10:25:09 +08:00
dip.go 改善切换的判断条件 2018-12-24 16:58:01 +08:00
main.go v1.0.0 2018-12-17 02:58:52 +08:00
readme.md 添加说明 2018-12-17 10:48:26 +08:00
start.sh add start script 2018-12-17 03:00:31 +08:00
switch_test.go 添加定期清理过期Ready列表 2018-12-22 03:30:25 +08:00
switch.go 改善切换的判断条件 2018-12-24 16:58:01 +08:00

说明:

根据actives.yaml配置, 添加adsl拨号的主机. eg:
switch:
  192.168.6.100:8080: 
    group: ["10.10.10.70", "10.10.10.71"] # 苏州
    city: "3205"
  192.168.6.100:8082:
    group: ["10.10.10.74", "10.10.10.75"] # 天津
    city: "12"
  192.168.6.100:8083: 
    group: ["10.10.10.76", "10.10.10.77"] # 滨州
    city: "3716"
restart: 50
192.168.6.100:8080 为代理的ip地址
group: 内为adsl主机的vpn节点ip
city: 为城市代码
restart: 为切换时间


http:/{ipcenter_host}/ippool/switch/actives 可以获取当前可用ip地址的json信息. eg:

{"192.168.6.100:8080":{"city":"3205","group":["10.10.10.70","10.10.10.71"]},"192.168.6.100:8082":{"city":"12","group":["10.10.10.74","10.10.10.75"]},"192.168.6.100:8083":{"city":"3716","group":["10.10.10.76","10.10.10.77"]},"192.168.6.100:8085":{"city":"5328","group":["10.10.10.80","10.10.10.81"]},"192.168.6.100:8087":{"city":"1506","group":["10.10.10.84","10.10.10.85"]},"192.168.6.100:8088":{"city":"4601","group":["10.10.10.86","10.10.10.87"]},"192.168.6.100:8091":{"city":"4602","group":["10.10.10.93","10.10.10.92"]}}

启动例子:

git clone http:... 
go build
sh start.sh