Handle missing arguments
This commit is contained in:
6
main.go
6
main.go
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"github.com/goburrow/netforward"
|
||||
"tailscale.com/tsnet"
|
||||
@@ -26,6 +27,11 @@ func (dialer Dialer) Dial() (net.Conn, error) {
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if !(host_proto != "" && hostname != "" && host_port != "" && dst_proto != "" && dst_addr != "") {
|
||||
fmt.Println("Usage: tsnet-proxy PROTO HOSTNAME PORT DST-PROTO DST")
|
||||
fmt.Println("Where PROTO is one of tcp, udp, unix")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
s := &tsnet.Server{
|
||||
Hostname: hostname,
|
||||
|
||||
Reference in New Issue
Block a user