2020-09-10 19:26:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
#include <iostream>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <string>
|
|
|
|
|
2021-01-06 21:43:48 +00:00
|
|
|
//! represents one item in the http history.
|
2020-09-10 19:26:41 +00:00
|
|
|
struct HistoryItem {
|
|
|
|
int id = -1;
|
|
|
|
double timestamp = 0;
|
|
|
|
std::string method;
|
|
|
|
std::string scheme;
|
|
|
|
std::string host;
|
|
|
|
unsigned short port = 0;
|
|
|
|
std::string path;
|
|
|
|
int status_code = 0;
|
|
|
|
std::string reason;
|
|
|
|
double rtt = 0.0;
|
|
|
|
size_t size = 0;
|
|
|
|
std::string request_http_version;
|
|
|
|
std::map<std::string, std::string> request_headers;
|
|
|
|
std::string request_content;
|
|
|
|
std::string response_http_version;
|
|
|
|
std::map<std::string, std::string> response_headers;
|
|
|
|
std::string response_content;
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace http {
|
|
|
|
|
|
|
|
struct Request
|
|
|
|
{
|
|
|
|
std::string server_ip_address;
|
|
|
|
|
|
|
|
bool tls;
|
|
|
|
std::string content;
|
|
|
|
std::string scheme;
|
|
|
|
std::string method;
|
|
|
|
std::string host;
|
|
|
|
unsigned short port;
|
|
|
|
std::string http_version;
|
|
|
|
std::string path;
|
|
|
|
double timestamp_start;
|
|
|
|
double timestamp_end;
|
|
|
|
std::vector<std::tuple<std::string,std::string>> headers;
|
|
|
|
|
|
|
|
std::string error;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Response {
|
|
|
|
int status_code;
|
|
|
|
std::string http_version;
|
|
|
|
std::string reason;
|
|
|
|
std::string content;
|
|
|
|
double timestamp_start;
|
|
|
|
double timestamp_end;
|
|
|
|
std::vector<std::tuple<std::string,std::string>> headers;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Flow {
|
|
|
|
std::string uid;
|
|
|
|
Request request;
|
|
|
|
Response response;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|