mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-01 18:27:18 +00:00
* incorporate existing SNI into allow/ignore decision, fix #5064 * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
17 lines
413 B
Python
Executable file
17 lines
413 B
Python
Executable file
#!/usr/bin/env python3
|
|
import fileinput
|
|
import re
|
|
import sys
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) < 3:
|
|
print(f"Usage: {sys.argv[0]} port filenames")
|
|
sys.exit()
|
|
|
|
port = sys.argv[1]
|
|
matches = False
|
|
for line in fileinput.input(sys.argv[2:]):
|
|
if re.search(r"^\[|(\d+\.){3}", line):
|
|
matches = port in line
|
|
if matches:
|
|
print(line, end="")
|