code: def check_ip(self):
          
          # For reverse proxy (nginx)
          forwarded_for = self.request.headers.get('X-Forwarded-For', None)
          if forwarded_for:
              return forwarded_for, _check_ip(forwarded_for)
  
          # For default method
          peer_name = self.request.transport.get_extra_info('peername')
          if peer_name is not None:
              host, _ = peer_name
              return host, _check_ip(host)
  
          # Not allowed and can't get client IP
          return None, False
docs: Check client IP. Accept requests only from telegram servers.
  
          :return: