-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathhttp_proxy.h
More file actions
30 lines (25 loc) · 826 Bytes
/
http_proxy.h
File metadata and controls
30 lines (25 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef HTTP_PROXY_H
#define HTTP_PROXY_H
#include "conf.h"
#include "main.h"
#include <arpa/inet.h>
#define HTTP_TYPE 0
#define OTHER_TYPE 1
typedef struct tcp_connection {
char *ready_data, *incomplete_data;
int fd, ready_data_len, incomplete_data_len, sent_len, timer;
uint16_t destPort;
unsigned reread_data:1, request_type:1, keep_alive:1;
} conn_t;
extern int remote_port;
extern char remote_host[CACHE_SIZE];
extern int sslEncodeCode;
extern conn_t cts[MAX_CONNECTION];
extern void tcp_in(conn_t * in, conf * configure);
extern void tcp_out(conn_t * out);
extern void close_connection(conn_t * conn);
extern char *request_head(conn_t * in, conf * configure);
extern void dataEncode(char *data, int data_len, unsigned code);
extern int timeout_minute;
void *tcp_timeout_check(void *nullPtr);
#endif