Skip to content

tethering

Accepted dataclass

Informs that port was successfully bound and got a specified connection id.

Source code in zendriver/cdp/tethering.py
@event_class("Tethering.accepted")
@dataclass
class Accepted:
    """
    Informs that port was successfully bound and got a specified connection id.
    """

    #: Port number that was successfully bound.
    port: int
    #: Connection id to be used.
    connection_id: str

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> Accepted:
        return cls(port=int(json["port"]), connection_id=str(json["connectionId"]))

connection_id: str instance-attribute

port: int instance-attribute

__init__(port, connection_id)

from_json(json) classmethod

Source code in zendriver/cdp/tethering.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> Accepted:
    return cls(port=int(json["port"]), connection_id=str(json["connectionId"]))

bind(port)

Request browser port binding.

Parameters:

Name Type Description Default
port int

Port number to bind.

required
Source code in zendriver/cdp/tethering.py
def bind(port: int) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Request browser port binding.

    :param port: Port number to bind.
    """
    params: T_JSON_DICT = dict()
    params["port"] = port
    cmd_dict: T_JSON_DICT = {
        "method": "Tethering.bind",
        "params": params,
    }
    json = yield cmd_dict

unbind(port)

Request browser port unbinding.

Parameters:

Name Type Description Default
port int

Port number to unbind.

required
Source code in zendriver/cdp/tethering.py
def unbind(port: int) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Request browser port unbinding.

    :param port: Port number to unbind.
    """
    params: T_JSON_DICT = dict()
    params["port"] = port
    cmd_dict: T_JSON_DICT = {
        "method": "Tethering.unbind",
        "params": params,
    }
    json = yield cmd_dict