Skip to content

Commit

Permalink
s/http/listen/
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrobenolt committed Oct 19, 2023
1 parent 9207c1d commit 896aa29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -12,4 +12,4 @@ FROM scratch
COPY --from=build /go/bin/ps-http-sim /ps-http-sim

EXPOSE 8080
ENTRYPOINT ["/ps-http-sim", "-http-addr=0.0.0.0"]
ENTRYPOINT ["/ps-http-sim", "-listen-addr=0.0.0.0"]
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -54,8 +54,8 @@ $(BIN)/$(app): main.go go.mod go.sum | $(BIN)

run: $(BIN)/$(app)
$< \
-http-addr=127.0.0.1 \
-http-port=8080 \
-listen-addr=127.0.0.1 \
-listen-port=8080 \
-mysql-addr=127.0.0.1 \
-mysql-port=3306 \
-mysql-idle-timeout=5s \
Expand Down
10 changes: 5 additions & 5 deletions main.go
Expand Up @@ -42,8 +42,8 @@ type timedConn struct {
var (
commandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError)

flagHTTPAddr = commandLine.String("http-addr", "127.0.0.1", "HTTP server address")
flagHTTPPort = commandLine.Uint("http-port", 8080, "HTTP server port")
flagListenAddr = commandLine.String("listen-addr", "127.0.0.1", "HTTP server address")
flagListenPort = commandLine.Uint("listen-port", 8080, "HTTP server port")
flagMySQLAddr = commandLine.String("mysql-addr", "127.0.0.1", "MySQL address")
flagMySQLPort = commandLine.Uint("mysql-port", 3306, "MySQL port")
flagMySQLNoPass = commandLine.Bool("mysql-no-pass", false, "Don't use password for MySQL connection")
Expand Down Expand Up @@ -129,11 +129,11 @@ func main() {
mux.Handle(psdbv1alpha1connect.NewDatabaseHandler(&server{}))

logger.Info("running",
log.String("addr", *flagHTTPAddr),
log.Uint("port", *flagHTTPPort),
log.String("addr", *flagListenAddr),
log.Uint("port", *flagListenPort),
)
panic(http.ListenAndServe(
fmt.Sprintf("%s:%d", *flagHTTPAddr, *flagHTTPPort),
fmt.Sprintf("%s:%d", *flagListenAddr, *flagListenPort),
h2c.NewHandler(mux, &http2.Server{}),
))
}
Expand Down

0 comments on commit 896aa29

Please sign in to comment.