Webiny\Component\Http\Request::getConnectionPort PHP Method

getConnectionPort() public method

This function check the forwarded headers from trusted proxies.
public getConnectionPort ( ) : integer
return integer Port number.
    public function getConnectionPort()
    {
        $port = 80;
        $host = $this->server()->httpHost();
        if (empty($host)) {
            return $port;
        }
        $host = $this->str($host);
        if ($host->contains(':')) {
            $port = $host->explode(':')->last();
        }
        return $port;
    }