revprxy/scripts/router.c
miri 50b377fc38 intermediate, commit
no idea what state this is in
2024-03-30 01:59:05 +01:00

23 lines
No EOL
546 B
C

#include "../src/router.h"
#include "../src/generic-helper.h"
#include <stdio.h>
struct stringPort{
char *hostname;
int port;
};
struct stringPort portList[]={
{"me.localhost", 1234},
{"fe.localhost", 1434},
};
int portListLen = sizeof(portList)/sizeof(portList[0]);
void selectRoute(struct routeConnInfo req, SSL *ssl){
printf("host: %s",req.hostname);
for (int i=0; i<portListLen; i++) {
if(cmphost(portList[i].hostname, (char*)req.hostname)){
proxyToPort(portList[i].port, ssl);
}
}
}