-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI.py
More file actions
39 lines (31 loc) · 874 Bytes
/
Copy pathAPI.py
File metadata and controls
39 lines (31 loc) · 874 Bytes
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
import os
import datetime
import server
import configuration
import endpoints
import send
def run(data):
os.chdir(os.path.dirname(os.path.abspath(__file__)))
while True:
config = configuration.set(data)
buffer = server.connect(config)
response = server.response(config, buffer)
request = endpoints.get(response)
output = endpoints.check(config, response, request)
send.output(config, output)
if output not in send.block():
print('\n')
print(str(datetime.datetime.now()))
print(request)
print(output)
if __name__ == '__main__':
ip = '0.0.0.0'
port = 1337
timeout = 1
database = 'values'
config = []
config.append(ip)
config.append(port)
config.append(timeout)
config.append(database)
run(config)