Skip to content

Commit

Permalink
Fix mitmproxy fails to start when starting Lyrebird (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
yumiguan authored May 29, 2023
1 parent 674b152 commit 003f60b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lyrebird/mitm/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def show_mitmdump_start_timeout_help(self, mitmdump_filepath, logger):
def wait_for_mitm_start(self, config, logger):
timeout = 30
wait_time_count = 0
ip = config.get('ip')
mock_port = config.get('mock.port')
proxy_port = config.get('proxy.port')
while True:
Expand All @@ -36,8 +37,10 @@ def wait_for_mitm_start(self, config, logger):
time.sleep(1)
wait_time_count += 1
try:
resp = requests.get(f'http://127.0.0.1:{mock_port}/api/status',
proxies={'http': f'http://127.0.0.1:{proxy_port}'})
resp = requests.get(
f'http://{ip}:{mock_port}/api/status',
proxies={'http': f'http://{ip}:{proxy_port}'}
)
if resp.status_code != 200:
continue
else:
Expand Down

0 comments on commit 003f60b

Please sign in to comment.