Skip to content

Unable to Specify that Proxy should listen on an address #316

Open
@oliverisaac

Description

If one tries to start the martian proxy such that it listens on only localhost then an error is thrown:

$ $GOPATH/bin/proxy -api-addr=localhost:9090
2021/03/31 12:59:42 strconv.Atoi: parsing "localhost9090": invalid syntax

martian/cmd/proxy/main.go

Lines 337 to 348 in dacbe1a

if *apiAddr != "" {
apip := strings.Replace(*apiAddr, ":", "", 1)
port, err := strconv.Atoi(apip)
if err != nil {
log.Fatal(err)
}
// Forward traffic that pattern matches in http.DefaultServeMux
apif := servemux.NewFilter(mux)
apif.SetRequestModifier(mapi.NewForwarder("", port))
topg.AddRequestModifier(apif)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions