Handle missing arguments
This commit is contained in:
6
main.go
6
main.go
@@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/goburrow/netforward"
|
"github.com/goburrow/netforward"
|
||||||
"tailscale.com/tsnet"
|
"tailscale.com/tsnet"
|
||||||
@@ -26,6 +27,11 @@ func (dialer Dialer) Dial() (net.Conn, error) {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
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{
|
s := &tsnet.Server{
|
||||||
Hostname: hostname,
|
Hostname: hostname,
|
||||||
|
|||||||
Reference in New Issue
Block a user