Exemple #1
0
func SavePing(data [8]byte) {
	frame := map[string]interface{}{
		"FrameMethod": "Ping",
		"Data":        data,
		"Time":        time.Now().Format(time.RFC3339),
	}
	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}
Exemple #2
0
func SaveSettingsFrame(settings []http2.Setting) {
	frame := map[string]interface{}{
		"FrameMethod": "SettingsFrame",
		"Settings":    settings,
		"Time":        time.Now().Format(time.RFC3339),
	}
	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}
Exemple #3
0
func SaveWindowUpdateFrame(streamId uint32, incr uint32) {
	frame := map[string]interface{}{
		"FrameMethod": "WindowUpdateFrame",
		"StreamID":    streamId,
		"Incr":        incr,
		"Time":        time.Now().Format(time.RFC3339),
	}
	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}
Exemple #4
0
func SaveDataFrame(streamID uint32, endStream bool, data []byte) {
	frame := map[string]interface{}{
		"FrameMethod": "DataFrame",
		"StreamID":    streamID,
		"EndStream":   endStream,
		"Data":        util.ToBase64(data),
		"Time":        time.Now().Format(time.RFC3339),
	}
	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}
Exemple #5
0
func SaveResetFrame(streamID uint32, errorCode uint32) {
	frame := map[string]interface{}{
		"FrameMethod": "ResetFrame",
		"StreamID":    streamID,
		"ErrorCode":   errorCode,
		"Time":        time.Now().Format(time.RFC3339),
	}

	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}
Exemple #6
0
func SaveRawFrame(frameType, flags uint8, streamID uint32, payload []byte) {
	frame := map[string]interface{}{
		"FrameMethod": "RawFrame",
		"FrameType":   frameType,
		"Flags":       flags,
		"StreamID":    streamID,
		"Payload":     util.ToBase64(payload),
	}

	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}
Exemple #7
0
func SavePriorityFrame(streamId, streamDep uint32, weight uint8, exclusive bool) {
	frame := map[string]interface{}{
		"FrameMethod": "PriorityFrame",
		"StreamID":    streamId,
		"StreamDep":   streamDep,
		"Weight":      weight,
		"Exclusive":   exclusive,
		"Time":        time.Now().Format(time.RFC3339),
	}
	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}
Exemple #8
0
func SaveHeadersFrame(streamId uint32, headers map[string]string, endStream bool, endHeaders bool) {
	frame := map[string]interface{}{
		"FrameMethod": "HeadersFrame",
		"StreamID":    streamId,
		"Headers":     headers,
		"EndStream":   endStream,
		"EndHeaders":  endHeaders,
		"Time":        time.Now().Format(time.RFC3339),
	}
	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}
Exemple #9
0
func SavePushPromiseFrame(streamID uint32, promiseID uint32, blockFragment []byte, endHeaders bool, padLength uint8) {
	frame := map[string]interface{}{
		"FrameMethod":   "PushPromiseFrame",
		"StreamID":      streamID,
		"PromiseID":     promiseID,
		"BlockFragment": blockFragment,
		"EndHeaders":    endHeaders,
		"PadLength":     padLength,
		"Time":          time.Now().Format(time.RFC3339),
	}
	out := util.ToJSON(frame)
	WriteToReplayFile(out)
}