2020-08-16 07:58:53 +08:00
|
|
|
#ifndef HTTP_PROXY_H
|
|
|
|
#define HTTP_PROXY_H
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
#include "conf.h"
|
2020-07-30 18:10:31 +08:00
|
|
|
#include "main.h"
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
#define HTTP_TYPE 0
|
|
|
|
#define OTHER_TYPE 1
|
|
|
|
|
2020-09-09 21:55:48 +08:00
|
|
|
extern int remote_port;
|
2020-11-05 21:56:08 +08:00
|
|
|
extern char remote_host[270];
|
2020-03-24 11:46:32 +08:00
|
|
|
extern int sslEncodeCode;
|
|
|
|
|
2020-01-21 19:48:05 +08:00
|
|
|
typedef struct conn_t {
|
|
|
|
int fd;
|
|
|
|
char *header_buffer;
|
|
|
|
int header_buffer_len, sent_len, timer;
|
2020-08-16 07:58:53 +08:00
|
|
|
unsigned request_type :1;
|
2020-01-21 19:48:05 +08:00
|
|
|
} conn;
|
|
|
|
|
|
|
|
extern conn cts[MAX_CONNECTION];
|
2020-06-08 20:28:15 +08:00
|
|
|
extern void tcp_in(conn * in, conf * configure);
|
|
|
|
extern void tcp_out(conn * out);
|
|
|
|
extern void close_connection(conn * conn);
|
2020-01-21 19:48:05 +08:00
|
|
|
|
2020-06-08 20:28:15 +08:00
|
|
|
extern char *request_head(conn * in, conf * configure);
|
2020-06-20 16:59:51 +08:00
|
|
|
void dataEncode(char *data, int data_len);
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
#endif
|