Skip to content

Commit

Permalink
web port range config for mitmweb
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-chao committed Jan 19, 2021
1 parent 2b49477 commit 88bee94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apptraffic-control/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def new_mitm_session_on_exit_node(self, exit_hub_name, exit_hub_password, entry_

proxy_port = network_ops.get_an_unused_local_port()
web_port = network_ops.get_an_unused_local_port()
if self.machine_config["MITMProxy"]["web_port_start"] and self.machine_config["MITMProxy"]["web_port_end"]:
web_port = network_ops.get_an_unused_local_port(range=(int(self.machine_config["MITMProxy"]["web_port_start"]), int(self.machine_config["MITMProxy"]["web_port_end"])))
subnet = network_ops.get_random_unused_subnet()

self.setup_exit_hub(subnet=subnet, exit_hub_name=exit_hub_name, exit_hub_password=exit_hub_password, entry_node_hostname=entry_node_hostname,
Expand Down
4 changes: 4 additions & 0 deletions apptraffic-control/machine_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ softether_vpn_l2tp_psk=your_l2tp_key
softether_password=your_vpn_server_password
gateway_interface=eth0

[MITMProxy]
web_port_start=
web_port_end=

[Stoarge]
session_data_path=/tmp/session_data/
session_config_path=/tmp/session_ca/
Expand Down

0 comments on commit 88bee94

Please sign in to comment.