Skip to content

Commit

Permalink
Allow overriding config with ENV (Grasscutters#506)
Browse files Browse the repository at this point in the history
Allow overriding config with ENV (handy when running with docker or debugging without modifying script)
Also log proxy config for easier debugging (when sharing screenshots)
  • Loading branch information
66Leo66 authored May 5, 2022
1 parent 207eba1 commit 3f46100
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions proxy_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
import os

# This can also be replaced with another IP address.
USE_SSL = True
REMOTE_HOST = "127.0.0.1"
REMOTE_PORT = 443
REMOTE_HOST = "localhost"
REMOTE_PORT = 443

if os.getenv('MITM_REMOTE_HOST') != None:
REMOTE_HOST = os.getenv('MITM_REMOTE_HOST')
if os.getenv('MITM_REMOTE_PORT') != None:
REMOTE_PORT = int(os.getenv('MITM_REMOTE_PORT'))
if os.getenv('MITM_USE_SSL') != None:
USE_SSL = bool(os.getenv('MITM_USE_SSL'))

print('MITM Remote Host: ' + REMOTE_HOST)
print('MITM Remote Port: ' + str(REMOTE_PORT))
print('MITM Use SSL ' + str(USE_SSL))

0 comments on commit 3f46100

Please sign in to comment.