Skip to content

Commit

Permalink
Add more obvious prompt to enter drawbridge address.
Browse files Browse the repository at this point in the history
Move some logging to slog. Needs to be supported better via cli flags.
  • Loading branch information
imdawon committed Mar 1, 2024
1 parent eb031f9 commit 7c9cd4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ func main() {
}

fmt.Println()

fmt.Println("Please enter your Drawbridge server URL or IP (e.g drawbridge.mysite.com:3100 or 50.162.50.224:3100):")
fmt.Println("Please note the default Drawbridge reverse proxy port is 3100.")
fmt.Print("Drawbridge server URL or IP: ")
var drawbridgeLocationResponse string
fmt.Scan(&drawbridgeLocationResponse)
fmt.Println()
Expand All @@ -85,7 +87,7 @@ func main() {
// wait for connection
conn, err := l.Accept()
if err != nil {
utils.PrintFinalError("Reverse proxy TCP Accept failed", err)
slog.Error("Reverse proxy TCP Accept failed", err)
}
// Handle new connection in a new go routine.
// The loop then returns to accepting, so that
Expand All @@ -94,7 +96,7 @@ func main() {
// connect to drawbridge on the port lsitening for the actual service
conn, err := tls.DialWithDialer(&net.Dialer{Timeout: 15 * time.Second}, "tcp", drawbridgeLocationResponse, tlsConfig)
if err != nil {
utils.PrintFinalError("Failed connecting to Drawbridge mTLS TCP server", err)
slog.Error("Failed connecting to Drawbridge mTLS TCP server", err)
return
}
defer conn.Close()
Expand Down

0 comments on commit 7c9cd4e

Please sign in to comment.