diff --git a/cmd/client/client.go b/cmd/client/client.go index 57dfa1f..997843b 100644 --- a/cmd/client/client.go +++ b/cmd/client/client.go @@ -1,11 +1,10 @@ -// // Copyright 2019 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -13,24 +12,26 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// // This binary creates a tunnel client to proxy incoming connections // over a grpc transport. // Exmaples to use this binary with ssh's ProxyCommand option: // TLS: -// ssh -o ProxyCommand="client -// --tunnel_server_address=localhost:$PORT \ -// --cert_file=$CERT_FILE \ -// --dial_target=target1 \ -// --dial_target_type=SSH" $USER@localhost +// +// ssh -o ProxyCommand="client +// --tunnel_server_address=localhost:$PORT \ +// --cert_file=$CERT_FILE \ +// --dial_target=target1 \ +// --dial_target_type=SSH" $USER@localhost +// // mTLS: -// ssh -o ProxyCommand="client -// --tunnel_server_address=localhost:$PORT \ -// --cert_file=$CERT_FILE \ -// --key_file=$KEY_FILE \ -// --ca_file=$CA_FILE \ -// --dial_target=target1 \ -// --dial_target_type=SSH" $USER@localhost +// +// ssh -o ProxyCommand="client +// --tunnel_server_address=localhost:$PORT \ +// --cert_file=$CERT_FILE \ +// --key_file=$KEY_FILE \ +// --ca_file=$CA_FILE \ +// --dial_target=target1 \ +// --dial_target_type=SSH" $USER@localhost package main import ( diff --git a/cmd/server/server.go b/cmd/server/server.go index 8155a22..efc7dd0 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -17,10 +17,13 @@ // This binary runs a tunnel server, which serves as a proxy between tunnel clients. // Exmaples to use this binary is with ssh's ProxyCommand option: // TLS: -// server --tunnel_address=localhost:$PORT \ -// --cert_file=$CERT_FILE \ +// +// server --tunnel_address=localhost:$PORT \ +// --cert_file=$CERT_FILE \ // --key_file=$KEY_FILE +// // mTLS: +// // server --tunnel_address=localhost:$PORT \ // --cert_file=$CERT_FILE \ // --key_file=$KEY_FILE \ diff --git a/cmd/target/target.go b/cmd/target/target.go index 3681a66..6c3895e 100644 --- a/cmd/target/target.go +++ b/cmd/target/target.go @@ -18,6 +18,7 @@ // If the incoming session is of supported type (SSH or GNMI), then it will be // relayed to a local port with the provide port. // Exmaple to use this binary: +// // target --config_file=$CONFIG_FILE package main diff --git a/tunnel/tunnel_test.go b/tunnel/tunnel_test.go index 89f63a4..a223bdc 100644 --- a/tunnel/tunnel_test.go +++ b/tunnel/tunnel_test.go @@ -953,7 +953,7 @@ func TestClientRun(t *testing.T) { ctx: ctx, maxSends: 10, streamRecv: []*tpb.RegisterOp{ - &tpb.RegisterOp{}, + {}, }, }}, c: client, @@ -1012,7 +1012,7 @@ func TestClientStart(t *testing.T) { client: &tunnelClient{ regStream: ®isterClientStream{ streamRecv: []*tpb.RegisterOp{ - &tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: false, Target: "testID"}}}, + {Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: false, Target: "testID"}}}, }, streamSend: []*tpb.RegisterOp{}, }, @@ -1024,7 +1024,7 @@ func TestClientStart(t *testing.T) { client: &tunnelClient{ regStream: ®isterClientStream{ streamRecv: []*tpb.RegisterOp{ - &tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, + {Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, }, streamSend: []*tpb.RegisterOp{}, }, @@ -1211,7 +1211,7 @@ func TestClientStreamHandler(t *testing.T) { client: &tunnelClient{ regStream: ®isterClientStream{ streamRecv: []*tpb.RegisterOp{ - &tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, + {Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, }, sendErr: true, }, @@ -1228,7 +1228,7 @@ func TestClientStreamHandler(t *testing.T) { client: &tunnelClient{ regStream: ®isterClientStream{ streamRecv: []*tpb.RegisterOp{ - &tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, + {Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, }, streamSend: []*tpb.RegisterOp{}, }, @@ -1248,7 +1248,7 @@ func TestClientStreamHandler(t *testing.T) { client: &tunnelClient{ regStream: ®isterClientStream{ streamRecv: []*tpb.RegisterOp{ - &tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, + {Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, }, streamSend: []*tpb.RegisterOp{}, }, @@ -1270,7 +1270,7 @@ func TestClientStreamHandler(t *testing.T) { client: &tunnelClient{ regStream: ®isterClientStream{ streamRecv: []*tpb.RegisterOp{ - &tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, + {Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, }, streamSend: []*tpb.RegisterOp{}, }, @@ -1290,7 +1290,7 @@ func TestClientStreamHandler(t *testing.T) { client: &tunnelClient{ regStream: ®isterClientStream{ streamRecv: []*tpb.RegisterOp{ - &tpb.RegisterOp{Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, + {Registration: &tpb.RegisterOp_Session{Session: &tpb.Session{Tag: 1, Accept: true, Target: "testID"}}}, }, streamSend: []*tpb.RegisterOp{}, },