diff --git a/duniterpy/api/client.py b/duniterpy/api/client.py index c53d1808bba620e2fe8345a3b60f761191991e52..fbffc341f9cf4b2dbd1d5424ed1818ad954d1722 100644 --- a/duniterpy/api/client.py +++ b/duniterpy/api/client.py @@ -189,17 +189,17 @@ class API: # remove starting slash in path if present path = path.lstrip("/") - server, port = self.connection_handler.server, self.connection_handler.port + address, port = self.connection_handler.address, self.connection_handler.port if self.connection_handler.path: - url = "{scheme}://{server}:{port}/{api_path}".format( + url = "{scheme}://{address}:{port}/{api_path}".format( scheme=scheme, - server=server, + address=address, port=port, api_path=self.connection_handler.path, ) else: - url = "{scheme}://{server}:{port}".format( - scheme=scheme, server=server, port=port + url = "{scheme}://{address}:{port}".format( + scheme=scheme, address=address, port=port ) if len(path.strip()) > 0: @@ -332,7 +332,7 @@ class Client: Init Client instance :param _endpoint: Endpoint string in duniter format - :param proxy: Proxy server as hostname:port (optional, default None) + :param proxy: Proxy address as hostname:port (optional, default None) """ if isinstance(_endpoint, str): # Endpoint Protocol detection diff --git a/duniterpy/api/endpoint.py b/duniterpy/api/endpoint.py index 2409f00eb95c942a4d6c3e39e73a2be303695358..f48020c21e2d38f26bd48f4314d05747c913fcfe 100644 --- a/duniterpy/api/endpoint.py +++ b/duniterpy/api/endpoint.py @@ -23,13 +23,13 @@ from ..documents import MalformedDocumentError class ConnectionHandler: - """Helper class used by other API classes to ease passing server connection information.""" + """Helper class used by other API classes to ease passing address connection information.""" def __init__( self, http_scheme: str, ws_scheme: str, - server: str, + address: str, port: int, path: str, proxy: Optional[str] = None, @@ -39,20 +39,20 @@ class ConnectionHandler: :param http_scheme: Http scheme :param ws_scheme: Web socket scheme - :param server: Server IP or domain name + :param address: Domain name, IPv6, or IPv4 address :param port: Port number :param port: Url path :param proxy: Proxy (optional, default=None) """ self.http_scheme = http_scheme self.ws_scheme = ws_scheme - self.server = server + self.address = address self.port = port self.path = path self.proxy = proxy def __str__(self) -> str: - return "connection info: %s:%d" % (self.server, self.port) + return "connection info: %s:%d" % (self.address, self.port) # required to type hint cls in classmethod