File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 6060 help = 'List of upstream proxies to use in the pool' ,
6161)
6262
63+ flags .add_argument (
64+ '--forward-all' ,
65+ action = 'store_true' ,
66+ help = 'Forward all requests to the proxy, including private IP requests'
67+ )
6368
6469class ProxyPoolPlugin (TcpUpstreamConnectionHandler , HttpProxyBasePlugin ):
6570 """Proxy pool plugin simply acts as a proxy adapter for proxy.py itself.
@@ -93,10 +98,12 @@ def before_upstream_connection(
9398 """
9499 # We don't want to send private IP requests to remote proxies
95100 try :
96- if ipaddress .ip_address (text_ (request .host )).is_private :
101+ if ipaddress .ip_address (text_ (request .host )).is_private and not self . flags . forward_all :
97102 return request
98103 except ValueError :
99104 pass
105+ except Exception as e :
106+ logger .error (f"Unexpected error happened before upstream connection: { e } " )
100107 # If chosen proxy is the local instance, bypass upstream proxies
101108 assert self ._endpoint .port and self ._endpoint .hostname
102109 if self ._endpoint .port == self .flags .port and \
You can’t perform that action at this time.
0 commit comments