Loop on errors, rather than failing
This commit is contained in:
10
main.go
10
main.go
@@ -35,10 +35,10 @@ func Forward(server *tsnet.Server, proto, port, dst string, finish chan error) {
|
||||
if err != nil {
|
||||
finish <- err
|
||||
}
|
||||
defer ln.Close()
|
||||
err = netforward.Forward(Dialer { proto: proto, addr: dst }, ln)
|
||||
if err != nil {
|
||||
finish <- err
|
||||
defer ln.Close();
|
||||
for true {
|
||||
err = netforward.Forward(Dialer { proto: proto, addr: dst }, ln);
|
||||
log.Print(err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,4 @@ func main() {
|
||||
proto, port, dst := args[0], args[1], args[2]
|
||||
go Forward(s, proto, port, dst, err_chan);
|
||||
}
|
||||
err := <- err_chan
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user