summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-10 03:12:09 -0500
committerJeff Carr <[email protected]>2025-03-10 07:59:25 -0500
commitfba2d24625d844b7f6115a6cb86f7fc6e1f9e3d5 (patch)
treef1e787166b7a9f9d54c9551b9bf3db6d89fc1e46 /main.go
parentdfbb8090acaba51ab29368202e5c97fd18856558 (diff)
start making it work in the real world
Diffstat (limited to 'main.go')
-rw-r--r--main.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/main.go b/main.go
index 6d02a2b..dbfbb90 100644
--- a/main.go
+++ b/main.go
@@ -50,9 +50,6 @@ func main() {
os.Exit(0)
}
- // go NewWatchdog()
- go startHTTP()
-
if gui.NoGui() {
all := me.portmaps.All()
for all.Scan() {
@@ -61,10 +58,13 @@ func main() {
continue
}
log.Info("portmap enabled for port", pm.Listen, "to", pm.Connect)
- gus3000(int(pm.Listen), pm.Connect)
+ go gus3000(int(pm.Listen), pm.Connect)
}
+ // startHTTP()
os.Exit(0)
}
+ // go NewWatchdog()
+ go startHTTP()
doGui()
}
@@ -85,10 +85,10 @@ func gus3000(port int, connect string) {
log.Printf("Failed to accept client connection: %v", err)
continue
}
- log.Printf("Client connected: %s", clientConn.RemoteAddr())
+ // log.Printf("Client connected: %s", clientConn.RemoteAddr())
// Handle the connection in a separate goroutine
- go handleConnection(clientConn, s)
+ go handleConnection(clientConn, connect)
}
}
@@ -103,7 +103,7 @@ func handleConnection(clientConn net.Conn, where string) {
return
}
defer targetConn.Close()
- log.Printf("Connected to target server: %s", targetConn.RemoteAddr())
+ log.Printf("Connected to target server: %s where = %s\n", targetConn.RemoteAddr(), where)
// Bidirectional copy of data
go io.Copy(targetConn, clientConn) // Client -> Target