#NEWLINE# @ property #NEWLINE# def host_port( self ) : #NEWLINE# #INDENT# '\n        The effective server port number as a string.  If the ``HTTP_HOST``\n        header exists in the WSGI environ, this attribute returns the port\n        number present in that header. If the ``HTTP_HOST`` header exists but\n        contains no explicit port number: if the WSGI url scheme is "https" ,\n        this attribute returns "443", if the WSGI url scheme is "http", this\n        attribute returns "80" .  If no ``HTTP_HOST`` header is present in\n        the environ at all, this attribute will return the value of the\n        ``SERVER_PORT`` header (which is guaranteed to be present).\n        ' #NEWLINE# e = port . environ #NEWLINE# host = e . get ( 'HTTP_HOST' ) #NEWLINE# if ( host is not None ) : #NEWLINE# #INDENT# if ( ':' in host ) : #NEWLINE# #INDENT# ( host , port ) = host . split ( ':' , 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# url_scheme = e [ 'wsgi.url_scheme' ] #NEWLINE# if ( url_scheme == 'https' ) : #NEWLINE# #INDENT# port = '443' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# port = '80' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# port = e [ 'SERVER_PORT' ] #NEWLINE# #UNINDENT# return port