23 lines
No EOL
546 B
C
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);
|
|
}
|
|
}
|
|
} |