okhttp / okhttp3 / HttpUrl / port

port

fun port(): Int

Returns the explicitly-specified port if one was provided, or the default port for this URL's scheme. For example, this returns 8443 for https://square.com:8443/ and 443 for https://square.com/. The result is in [1..65535].