src/Request.php
public function setPort($port) {
        $this->env['SERVER_PORT'] = $port;

        // Override the scheme for standard ports.
        if ($port === 80) {
            $this->setScheme('http');
        } elseif ($port === 443) {
            $this->setScheme('https');
        }

        return $this;
    }
public function setPort($port) {
        $this->env['SERVER_PORT'] = $port;

        // Override the scheme for standard ports.
        if ($port === 80) {
            $this->setScheme('http');
        } elseif ($port === 443) {
            $this->setScheme('https');
        }

        return $this;
    }
Sets the port.

Setting the port to 80 or 443 will also set the scheme to http or https respectively.

@param int $port The port to set.
@return Request Returns $this for fluent calls.