1414import os
1515import time
1616
17+ from utils .version import __slim__
1718from utils .handlers import ProxyHandlers
1819from utils .proxy .filter import filter_process
19- from utils .proxy .shortcuts import shortcuts_process
2020from utils .proxy .cancel_inspect import cancel_inspect_process
21- from utils .proxy .custom_header import custom_header_process
22- from utils .proxy .monitoring import start_flask_server
2321from utils .logger import configure_file_logger , configure_console_logger
22+ if not __slim__ :
23+ from utils .proxy .shortcuts import shortcuts_process
24+ if not __slim__ :
25+ from utils .proxy .custom_header import custom_header_process
26+ if not __slim__ :
27+ from utils .proxy .monitoring import start_flask_server
2428
2529# pylint: disable=too-few-public-methods,too-many-locals
2630class ProxyServer :
@@ -104,7 +108,8 @@ def _initialize_processes(self):
104108 self .filter_proc .start ()
105109 self .console_logger .debug ("[*] Starting the filter process..." )
106110
107- if self .config_shortcuts and os .path .isfile (self .config_shortcuts ):
111+ # pylint: disable=E0606
112+ if not __slim__ and self .config_shortcuts and os .path .isfile (self .config_shortcuts ):
108113 self .shortcuts_proc = multiprocessing .Process (
109114 target = shortcuts_process ,
110115 args = (
@@ -128,7 +133,8 @@ def _initialize_processes(self):
128133 self .cancel_inspect_proc .start ()
129134 self .console_logger .debug ("[*] Starting the cancel inspection process..." )
130135
131- if self .config_custom_header and os .path .isfile (self .config_custom_header ):
136+ # pylint: disable=E0606
137+ if not __slim__ and self .config_custom_header and os .path .isfile (self .config_custom_header ):
132138 self .custom_header_proc = multiprocessing .Process (
133139 target = custom_header_process ,
134140 args = (
@@ -178,13 +184,14 @@ def start(self):
178184
179185 self ._initialize_processes ()
180186
181- flask_thread = threading .Thread (
182- target = start_flask_server ,
183- args = (self ,self .flask_port ,self .flask_pass ,self .debug ),
184- daemon = True
185- )
186- flask_thread .start ()
187- self .console_logger .debug ("[*] Starting the monitoring process..." )
187+ if not __slim__ :
188+ flask_thread = threading .Thread (
189+ target = start_flask_server ,
190+ args = (self ,self .flask_port ,self .flask_pass ,self .debug ),
191+ daemon = True
192+ )
193+ flask_thread .start ()
194+ self .console_logger .debug ("[*] Starting the monitoring process..." )
188195
189196 server = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
190197 server .bind (self .host_port )
0 commit comments