-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathint_proxy.py
More file actions
27 lines (23 loc) · 784 Bytes
/
int_proxy.py
File metadata and controls
27 lines (23 loc) · 784 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
from candice_types import ProxyBase
from django.conf import settings
host_drive = '/home/james/tmpdev/host/'
class InternalProxy(ProxyBase):
def __init__(self):
ProxyBase.__init__(self)
self.default_db = 'host'
def process(self, request):
if request.flag == 'requested':
self.outgoing(request)
request.save(using='courier')
request.flag = 'transit'
request.save(using='host')
elif request.flag == 'retrieved':
self.incoming(request)
request.flag = 'completed'
request.save(using='host')
request.delete(using='courier')
settings.configure()
proxy = InternalProxy()
proxy.host_path = host_drive
print('Listening for usb devices...')
proxy.start()