From 1bc55504007eaa8179e914c6a991a6bcc0e40ce4 Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Sat, 7 May 2022 18:55:58 -0700 Subject: [PATCH 1/3] also allow main echo/http port to be disabled; so a server can be started as just grpc-port for instance --- fortio_main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fortio_main.go b/fortio_main.go index 3230a99c0..47fa194f5 100644 --- a/fortio_main.go +++ b/fortio_main.go @@ -110,7 +110,7 @@ var ( profileFlag = flag.String("profile", "", "write .cpu and .mem profiles to `file`") grpcFlag = flag.Bool("grpc", false, "Use GRPC (health check by default, add -ping for ping) for load testing") echoPortFlag = flag.String("http-port", "8080", - "http echo server port. Can be in the form of host:port, ip:port, `port` or /unix/domain/path.") + "http echo server port. Can be in the form of host:port, ip:port, `port` or /unix/domain/path or \""+disabled+"\".") tcpPortFlag = flag.String("tcp-port", "8078", "tcp echo server port. Can be in the form of host:port, ip:port, `port` or /unix/domain/path or \""+disabled+"\".") udpPortFlag = flag.String("udp-port", "8078", @@ -271,8 +271,10 @@ func main() { if *redirectFlag != disabled { fhttp.RedirectToHTTPS(*redirectFlag) } - if !ui.Serve(baseURL, *echoPortFlag, *echoDbgPathFlag, *uiPathFlag, *dataDirFlag, percList) { - os.Exit(1) // error already logged + if *echoPortFlag != disabled { + if !ui.Serve(baseURL, *echoPortFlag, *echoDbgPathFlag, *uiPathFlag, *dataDirFlag, percList) { + os.Exit(1) // error already logged + } } startProxies() case "grpcping": From ed9886428ab8e854a7a705c0941494398ab9ff92 Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Sat, 7 May 2022 19:38:50 -0700 Subject: [PATCH 2/3] fix linter --- fortio_main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortio_main.go b/fortio_main.go index 47fa194f5..73c562471 100644 --- a/fortio_main.go +++ b/fortio_main.go @@ -185,7 +185,7 @@ var ( calcQPS = flag.Bool("calc-qps", false, "Calculate the qps based on number of requests (-n) and duration (-t)") ) -// nolint: funlen // well yes it's fairly big and lotsa ifs. +// nolint: funlen,gocyclo // well yes it's fairly big and lotsa ifs. func main() { flag.Var(&proxiesFlags, "P", "Tcp proxies to run, e.g -P \"localport1 dest_host1:dest_port1\" -P \"[::1]:0 www.google.com:443\" ...") From b54f17480d8b3ced4b6fc3a90b97564216bf4dd4 Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Sat, 7 May 2022 21:43:33 -0700 Subject: [PATCH 3/3] add test against grpc.fortio.org:8079 and update commented out tests for https/grpc --- README.md | 4 +++- Webtest.sh | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 87845c9f7..a635936df 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,10 @@ fortio.exe server Once `fortio server` is running, you can visit its web UI at [http://localhost:8080/fortio/](http://localhost:8080/fortio/) -You can get a preview of the reporting/graphing UI at [https://fortio.istio.io/](https://fortio.istio.io/) +You can get a preview of the reporting/graphing UI at [https://demo.fortio.org/](https://demo.fortio.org/). + ## Command line arguments diff --git a/Webtest.sh b/Webtest.sh index 43218b645..cc1170810 100755 --- a/Webtest.sh +++ b/Webtest.sh @@ -105,12 +105,12 @@ docker exec $DOCKERNAME $FORTIO_BIN_PATH load -H Foo:Bar -H Blah:Blah -qps 1 -t # Do a grpcping docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping localhost # Do a grpcping to a scheme-prefixed destination. Fortio should append port number -# re-enable once we get https://demo.fortio.org/ -# docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping https://fortio.istio.io -# docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping http://fortio.istio.io +# re-enable once we get https://grpc.fortio.org:/ fully working with https too +# docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping https://grpc.fortio.org +docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping grpc.fortio.org:8079 # Do a grpcping with -cert flag. Fortio should use valid cert. -# docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping -cacert $CERT fortio.istio.io:443 -# docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping -cacert $CERT https://fortio.istio.io +# docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping -cacert $CERT grpc.fortio.org:443 +# docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping -cacert $CERT https://grpc.fortio.org # Do a local grpcping. Fortio should append default grpc port number to destination docker exec $DOCKERNAME $FORTIO_BIN_PATH grpcping localhost # pprof should be there, no 404/error