Reverse proxy working

This commit is contained in:
2021-01-07 21:58:45 +01:00
parent 785ab31890
commit 95946b1666
12 changed files with 515 additions and 387 deletions

32
src/sock.h Normal file
View File

@ -0,0 +1,32 @@
/**
* Necronda Web Server
* Basic TCP and TLS socket (header file)
* src/sock.h
* Lorenz Stechauner, 2021-01-07
*/
#ifndef NECRONDA_SERVER_SOCK_H
#define NECRONDA_SERVER_SOCK_H
typedef struct {
unsigned int enc:1;
int socket;
SSL_CTX *ctx;
SSL *ssl;
char *buf;
unsigned long buf_len;
unsigned long buf_off;
long _last_ret;
int _errno;
unsigned long _ssl_error;
} sock;
const char *sock_strerror(sock *s);
long sock_send(sock *s, void *buf, unsigned long len, int flags);
long sock_recv(sock *s, void *buf, unsigned long len, int flags);
long sock_splice(sock *dst, sock *src, void *buf, unsigned long buf_len, unsigned long len);
#endif //NECRONDA_SERVER_SOCK_H