2024-07-21 20:41:14 +00:00
|
|
|
#ifndef STRUCTS_H
|
|
|
|
#define STRUCTS_H
|
|
|
|
|
2024-07-31 22:11:41 +00:00
|
|
|
#define SERVER_MODE "server"
|
|
|
|
#define CLIENT_MODE "client"
|
|
|
|
|
|
|
|
#define PROXY_PORT 2020
|
|
|
|
#define PROXY_CONN 20
|
2024-08-02 16:38:13 +00:00
|
|
|
#define PROXY_MAX_MSGLEN 1000*1024
|
2024-07-31 22:11:41 +00:00
|
|
|
|
|
|
|
#define REGEX_MATCHN 4
|
2024-08-02 16:38:13 +00:00
|
|
|
#define REGEX_TITLE "^([A-Z]+)[ ]+([a-zA-Z0-9\\:/_.,-]+)"\
|
|
|
|
"[ ]+([a-zA-Z0-9_.,/-]+)[\n\r]*$"
|
2024-08-01 10:27:38 +00:00
|
|
|
#define REGEX_HEADER "^([a-zA-Z0-9_-]*):[ \t]+([^\r\n]*)"
|
2024-07-31 22:11:41 +00:00
|
|
|
|
|
|
|
#define CLIENT_MESSAGE "GET http://google.com/auth HTTP/1.0\n"\
|
|
|
|
"\n"\
|
|
|
|
"Host: google.com\n"\
|
|
|
|
"Authorization: Bearer ffja2439gjawgjgojserg\n"
|
|
|
|
|
2024-07-21 20:41:14 +00:00
|
|
|
struct header {
|
|
|
|
char *key;
|
|
|
|
char *value;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct http_msg {
|
|
|
|
char *method;
|
|
|
|
char *uri;
|
|
|
|
char *ver;
|
2024-07-31 22:11:41 +00:00
|
|
|
int header_num;
|
2024-07-21 20:41:14 +00:00
|
|
|
struct header *headers;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|