code: def get_payload(self, data):
          
          start = 2
          length = ord(data[1:2])
          if length == 126:
              # Payload information are an extra 2 bytes.
              start = 4
              length, = unpack(">H", data[2:4])
          elif length == 127:
              # Payload information are an extra 6 bytes.
              start = 8
              length, = unpack(">I", data[2:6])
          end = start + length
          payload = json.loads(data[start:end].decode())
          extra_data = data[end:]
          return payload, extra_data
docs: Parse length of payload and return it.