def port_for_scheme(scheme):
    """Calculate port based on ``scheme`` name. If scheme and port matches,
    port is left empty. Otherwise `port` is explicitly set to port number and
    returned as a string.
    
    ``scheme``, byte-string.
    """
    if scheme == b'http':
        return 80
    elif scheme == b'https':
        return 443
    else:
        return None
