Parcourir la source

add IPv4/IPv6 selection for outgoing connections

z3APA3A il y a 11 ans
Parent
commit
10bc0db2a8
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. 9 1
      src/proxymain.c

+ 9 - 1
src/proxymain.c

@@ -73,7 +73,11 @@ int MODULEMAINFUNC (int argc, char** argv){
 	" -bBUFSIZE size of network buffer (default 4096 for TCP, 16384 for UDP)\n"
 	" -t be silent (do not log service start/stop)\n"
 	" -iIP ip address or internal interface (clients are expected to connect)\n"
-	" -eIP ip address or external interface (outgoing connection will have this)\n";
+	" -eIP ip address or external interface (outgoing connection will have this)\n"
+	" -4 Use IPv4 for outgoing connections\n"
+	" -6 Use IPv6 for outgoing connections\n"
+	" -46 Prefer IPv4 for outgoing connections, use both IPv4 and IPv6\n"
+	" -64 Prefer IPv6 for outgoing connections, use both IPv4 and IPv6\n";
 
 #ifdef _WIN32
  unsigned long ul = 1;
@@ -189,6 +193,10 @@ int MODULEMAINFUNC (int argc, char** argv){
 		 case 'p':
 			*SAPORT(&srv.intsa) = htons(atoi(argv[i]+2));
 			break;
+		 case '4':
+		 case '6':
+			srv.family = atoi(argv[i]);
+			break;
 		 case 'b':
 			srv.bufsize = atoi(argv[i]+2);
 			break;