API_endpoint
Api_Endpoint
This request allows retrieving the current TCP API endpoint configuration, and is read-only.
The request looks like this:
{
"api_endpoint": true //Actual contents ignored, the mere presence of this member is enough
}
The response is a string as follows:
{
"api_endpoint": "http://127.0.0.1:4242/"
}
The response is a full HTTP URL that can be used to access the TCP API port from the local machine, at least. If the API port is bound to a specific interface or address, the correct address will be listed. If the port was changed from the default, the response will reflect this change as well. The mean purpose of this method is to be used over the UDP API to reliably establish the correct means to connect to the TCP API, but it can also be used to retrieve a canonical address for other purposes.
When the API is bound to all interfaces ("::" (IPv6) or "0.0.0.0" (IPv4)), it will respond with an appropriate IPv6 or IPv4 localhost address ("::1" or "127.0.0.1"), since the catch-all address cannot be connected to. This means the call is not reliable for external connections, and should only be used to infer information about configuration on the local host.