Skip to content

Commit

Permalink
goal: user defined scheme to connect to remote host (#4922)
Browse files Browse the repository at this point in the history
  • Loading branch information
win-t committed Mar 11, 2023
1 parent 1fe68f4 commit 7b11fc7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nodecontrol/algodControl.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os/exec"
"path/filepath"
"strconv"
"strings"
"time"

"github.com/algorand/go-algorand/config"
Expand Down Expand Up @@ -85,6 +86,13 @@ func (nc NodeController) ServerURL() (url.URL, error) {
if err != nil {
return url.URL{}, err
}
if strings.HasPrefix(addr, "http:") || strings.HasPrefix(addr, "https:") {
u, err := url.Parse(addr)
if err != nil {
return url.URL{}, err
}
return *u, nil
}
return url.URL{Scheme: "http", Host: addr}, nil
}

Expand Down

0 comments on commit 7b11fc7

Please sign in to comment.