summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--VPN.md4
-rw-r--r--main.c6
-rwxr-xr-xscripts/tokssh4
-rw-r--r--util.c2
5 files changed, 9 insertions, 9 deletions
diff --git a/README.md b/README.md
index 06443ef..de1c5ad 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ The -L switch works (almost) the same way it does in SSH. For the uninitiated, -
54 54
55Alternatively, SSH ProxyCommand mode works too: 55Alternatively, SSH ProxyCommand mode works too:
56 56
57 ssh -o ProxyCommand='./tuntox -i <ToxID> -P localhost:22' gdr@localhost 57 ssh -o ProxyCommand='./tuntox -i <ToxID> -W localhost:22' gdr@localhost
58 58
59Fun stuff: [VPN over Tox](VPN.md) 59Fun stuff: [VPN over Tox](VPN.md)
60 60
diff --git a/VPN.md b/VPN.md
index 73faf4c..7fe339a 100644
--- a/VPN.md
+++ b/VPN.md
@@ -8,7 +8,7 @@ On the server (where tuntox is already running):
8 8
9On the client: 9On the client:
10 10
11 socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:./tuntox -P 127.0.0.1@9876 -i 86e70ffe9f835b12667d296f2df9c307ba1aff06' 11 socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:./tuntox -W 127.0.0.1@9876 -i 86e70ffe9f835b12667d296f2df9c307ba1aff06'
12 12
13Viola, you have a point-to-point VPN. On client: 13Viola, you have a point-to-point VPN. On client:
14 14
@@ -28,7 +28,7 @@ Also: inefficient, insecure (requires PermitRootLogin yes on server).
28 28
29On the client: 29On the client:
30 30
31 socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:ssh root@localhost -o ProxyCommand=\"./tuntox -P "127.0.0.1:22" -d -i 86e70ffe9f835b12667d296f2df9c307ba1aff06\" socat -d -d - "TUN:10.20.30.41/24,up"' 31 socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:ssh root@localhost -o ProxyCommand=\"./tuntox -W "127.0.0.1:22" -d -i 86e70ffe9f835b12667d296f2df9c307ba1aff06\" socat -d -d - "TUN:10.20.30.41/24,up"'
32 32
33 # ping 10.20.30.41 33 # ping 10.20.30.41
34 PING 10.20.30.41 (10.20.30.41) 56(84) bytes of data. 34 PING 10.20.30.41 (10.20.30.41) 56(84) bytes of data.
diff --git a/main.c b/main.c
index 4d211d7..0d2e5e8 100644
--- a/main.c
+++ b/main.c
@@ -1181,7 +1181,7 @@ void help()
1181 fprintf(stderr, " -i <toxid> - remote point Tox ID\n"); 1181 fprintf(stderr, " -i <toxid> - remote point Tox ID\n");
1182 fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n"); 1182 fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n");
1183 fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); 1183 fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n");
1184 fprintf(stderr, " -P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n"); 1184 fprintf(stderr, " -W <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n");
1185 fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n"); 1185 fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n");
1186 fprintf(stderr, " -p - ping the server from -i and exit\n"); 1186 fprintf(stderr, " -p - ping the server from -i and exit\n");
1187 fprintf(stderr, " Common:\n"); 1187 fprintf(stderr, " Common:\n");
@@ -1237,13 +1237,13 @@ int main(int argc, char *argv[])
1237 } 1237 }
1238 log_printf(L_DEBUG, "Forwarding remote port %d to local port %d\n", remote_port, local_port); 1238 log_printf(L_DEBUG, "Forwarding remote port %d to local port %d\n", remote_port, local_port);
1239 break; 1239 break;
1240 case 'P': 1240 case 'W':
1241 /* Pipe forwarding */ 1241 /* Pipe forwarding */
1242 client_mode = 1; 1242 client_mode = 1;
1243 client_pipe_mode = 1; 1243 client_pipe_mode = 1;
1244 if(parse_pipe_port_forward(optarg, &remote_host, &remote_port) < 0) 1244 if(parse_pipe_port_forward(optarg, &remote_host, &remote_port) < 0)
1245 { 1245 {
1246 log_printf(L_ERROR, "Invalid value for -P option - use something like -P 127.0.0.1:22\n"); 1246 log_printf(L_ERROR, "Invalid value for -W option - use something like -W 127.0.0.1:22\n");
1247 exit(1); 1247 exit(1);
1248 } 1248 }
1249 if(min_log_level == L_UNSET) 1249 if(min_log_level == L_UNSET)
diff --git a/scripts/tokssh b/scripts/tokssh
index 0017221..6bdb74d 100755
--- a/scripts/tokssh
+++ b/scripts/tokssh
@@ -29,9 +29,9 @@ then
29# last argument is user@toxid 29# last argument is user@toxid
30 user=${arruserhost[0]} 30 user=${arruserhost[0]}
31 toxid=${arruserhost[1]} 31 toxid=${arruserhost[1]}
32 ssh -o ProxyCommand="tuntox -i $toxid -P 127.0.0.1:%p $secret" $args $user@localhost 32 ssh -o ProxyCommand="tuntox -i $toxid -W 127.0.0.1:%p $secret" $args $user@localhost
33else 33else
34# last argument is just toxid 34# last argument is just toxid
35 ssh -o ProxyCommand="tuntox -i $userhost -P 127.0.0.1:%p $secret" $args localhost 35 ssh -o ProxyCommand="tuntox -i $userhost -W 127.0.0.1:%p $secret" $args localhost
36fi 36fi
37 37
diff --git a/util.c b/util.c
index b1353b3..4d75fe5 100644
--- a/util.c
+++ b/util.c
@@ -114,7 +114,7 @@ int parse_local_port_forward(char *string, int *local_port, char **hostname, int
114 return 0; 114 return 0;
115} 115}
116 116
117/* Parse the -P parameter */ 117/* Parse the -W parameter */
118/* 0 = success */ 118/* 0 = success */
119int parse_pipe_port_forward(char *string, char **hostname, int *remote_port) 119int parse_pipe_port_forward(char *string, char **hostname, int *remote_port)
120{ 120{