#include <stdio.h>
#include <stdlib.h>
#include <winsock.h>
#include <signal.h>
#include <errno.h>
#include <io.h>
#pragma comment(lib, "ws2_32.lib")
#define VERSION "1.00"
#define TIMEOUT 300
#define MAXSIZE 20480
#define HOSTLEN 40
#define CONNECTNUM 5
// define 2 socket struct
struct transocket
{
SOCKET fd1;
SOCKET fd2;
};
// define function
void ver();
void usage(char *prog);
void transmitdata(LPVOID data);
void getctrlc(int j);
void closeallfd();
void makelog(char *buffer, int length);
void proxy(int port);
void bind2bind(int port1, int port2);
void bind2conn(int port1, char *host, int port2);
void conn2conn(char *host1, int port1, char *host2, int port2);
int testifisvalue(char *str);
int create_socket();
int create_server(int sockfd, int port);
int client_connect(int sockfd, char* server, int port);
// define GLOBAL variable here
extern int errno;
FILE *fp;
int method=0;
//int connectnum=0;
/
if((sockfd1=create_socket())==0) return;
if((sockfd2=create_socket())==0) return;
printf("[+] Make a Connection to %s:%d....\r\n",host1,port1);
fflush(stdout);
if(client_connect(sockfd1,host1,port1)==0)
{
closesocket(sockfd1);
closesocket(sockfd2);
continue;
}
// fix by bkbll
// if host1:port1 recved data, than connect to host2,port2
l=0;
memset(buffer,0,MAXSIZE);
while(1)
{
FD_ZERO(&fds);