Tunnel
Tunnel(
port,
check_local_port=True,
debug=False,
timeout=60,
propagate=False,
log_handlers=None,
log_dir=None,
callback=None,
)
Tunnel class for managing subprocess-based tunnels.
| Parameters: |
|
|---|
Note
output of each tunnel command will be saved to log_dir
with_tunnel_list
classmethod
with_tunnel_list(
port,
tunnel_list,
check_local_port=True,
debug=False,
timeout=60,
propagate=False,
log_handlers=None,
log_dir=None,
callback=None,
)
Create a Tunnel instance with a pre-defined list of tunnels.
| Parameters: |
|
|---|
| Raises: |
|
|---|
Note
output of each tunnel command will be saved to log_dir
add_tunnel
add_tunnel(
*, command, pattern, name, note=None, callback=None
)
Add a tunnel.
| Parameters: |
|
|---|
Note
name must be unique name as is being used for .log file,
start
start()
Start the tunnel and wait for the URLs to be printed.
| Raises: |
|
|---|
stop
stop()
Stop the tunnel and reset internal state.
| Raises: |
|
|---|
reset
reset()
Reset internal state.
is_port_in_use
staticmethod
is_port_in_use(port)
Check if the specified port is in use.
| Parameters: |
|
|---|
| Returns: |
|
|---|
wait_for_condition
staticmethod
wait_for_condition(condition, *, interval=1, timeout=10)
Wait for the condition to be true until the specified timeout.
Mostly for internal use but can be used for anything else.
| Parameters: |
|
|---|
| Returns: |
|
|---|