Parse the command line arguments. :return: The parsed arguments.
()
| 25 | |
| 26 | |
| 27 | def parse_args() -> argparse.Namespace: |
| 28 | """Parse the command line arguments. |
| 29 | |
| 30 | :return: The parsed arguments. |
| 31 | """ |
| 32 | parser = argparse.ArgumentParser() |
| 33 | parser.add_argument("proxy_address", help="Address of the proxy to connect to.") |
| 34 | parser.add_argument("proxy_port", type=int, help="The port of the proxy to connect to.") |
| 35 | parser.add_argument( |
| 36 | '-s', |
| 37 | '--server-hostname', |
| 38 | dest="server_hostname", |
| 39 | default="some.server.com", |
| 40 | help="The hostname of the server to connect to.") |
| 41 | return parser.parse_args() |
| 42 | |
| 43 | |
| 44 | def open_connection(address: str, port: int) -> socket.socket: |