forked from SpiderClub/haipproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigs.py
51 lines (40 loc) · 1.23 KB
/
configs.py
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
51
# haipproxy client settings, which should be the same with
# settings for haipproxy server
LONGEST_RESPONSE_TIME = 10
LOWEST_SCORE = 6
LOWEST_TOTAL_PROXIES = 6
DATA_ALL = 'haipproxy:all'
TEMP_HTTP_QUEUE = 'haipproxy:http:temp'
TEMP_HTTPS_QUEUE = 'haipproxy:https:temp'
TEMP_ZHIHU_QUEUE = 'haipproxy:zhihu:temp'
VALIDATED_HTTP_QUEUE = 'haipproxy:validated:http'
VALIDATED_HTTPS_QUEUE = 'haipproxy:validated:https'
VALIDATED_ZHIHU_QUEUE = 'haipproxy:validated:zhihu'
TTL_VALIDATED_RESOURCE = 2 # minutes
TTL_HTTP_QUEUE = 'haipproxy:ttl:http'
TTL_HTTPS_QUEUE = 'haipproxy:ttl:https'
TTL_ZHIHU_QUEUE = 'haipproxy:ttl:zhihu'
SPEED_HTTP_QUEUE = 'haipproxy:speed:http'
SPEED_HTTPS_QUEUE = 'haipproxy:speed:https'
SPEED_ZHIHU_QUEUE = 'haipproxy:speed:zhihu'
SCORE_MAPS = {
'http': VALIDATED_HTTP_QUEUE,
'https': VALIDATED_HTTPS_QUEUE,
'zhihu': VALIDATED_ZHIHU_QUEUE
}
TTL_MAPS = {
'http': TTL_HTTP_QUEUE,
'https': TTL_HTTPS_QUEUE,
'zhihu': TTL_ZHIHU_QUEUE
}
SPEED_MAPS = {
'http': SPEED_HTTP_QUEUE,
'https': SPEED_HTTPS_QUEUE,
'zhihu': SPEED_ZHIHU_QUEUE
}
# custom settings for your project
TOTAL_SUCCESS_REQUESTS = 'zhihu:success:request'
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
REDIS_PASS = '123456'
REDIS_DB = 0