#NEWLINE# @ app . route ( '/register_ip' ) #NEWLINE# @ basic_auth . required #NEWLINE# def register_ip_handler( ) : #NEWLINE# #INDENT# hostname = request . authorization . username #NEWLINE# domain = '.' . join ( hostname . split ( '.' ) [ 1 : ] ) #NEWLINE# ipaddr = request . environ . get ( 'HTTP_X_FORWARDED_FOR' ) #NEWLINE# if ( not ipaddr ) : #NEWLINE# #INDENT# ipaddr = request . remote_addr #NEWLINE# #UNINDENT# register_ip ( domain , ipaddr , ipaddr ) #NEWLINE# return ''