Skip to content

Commit

Permalink
Plug in the ErrorHandlers for JSON/color compatibility of http lib lo…
Browse files Browse the repository at this point in the history
…gging (#812)

* Fix #802 - plug in the ErrorHandlers

* Bump to 1.58.0
  • Loading branch information
ldemailly committed Aug 4, 2023
1 parent bddad00 commit fef3d6d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- 1.57.5 -->
<!-- 1.58.0 -->
# Fortio

[![Awesome Go](https://fortio.org/mentioned-badge.svg)](https://github.com/avelino/awesome-go#networking)
Expand Down Expand Up @@ -60,13 +60,13 @@ You can install from source:
The [releases](https://github.com/fortio/fortio/releases) page has binaries for many OS/architecture combinations (see assets):

```shell
curl -L https://github.com/fortio/fortio/releases/download/v1.57.5/fortio-linux_amd64-1.57.5.tgz \
curl -L https://github.com/fortio/fortio/releases/download/v1.58.0/fortio-linux_amd64-1.58.0.tgz \
| sudo tar -C / -xvzpf -
# or the debian package
wget https://github.com/fortio/fortio/releases/download/v1.57.5/fortio_1.57.5_amd64.deb
dpkg -i fortio_1.57.5_amd64.deb
wget https://github.com/fortio/fortio/releases/download/v1.58.0/fortio_1.58.0_amd64.deb
dpkg -i fortio_1.58.0_amd64.deb
# or the rpm
rpm -i https://github.com/fortio/fortio/releases/download/v1.57.5/fortio-1.57.5-1.x86_64.rpm
rpm -i https://github.com/fortio/fortio/releases/download/v1.58.0/fortio-1.58.0-1.x86_64.rpm
# and more, see assets in release page
```

Expand All @@ -76,7 +76,7 @@ On a MacOS you can also install Fortio using [Homebrew](https://brew.sh/):
brew install fortio
```

On Windows, download https://github.com/fortio/fortio/releases/download/v1.57.5/fortio_win_1.57.5.zip and extract `fortio.exe` to any location, then using the Windows Command Prompt:
On Windows, download https://github.com/fortio/fortio/releases/download/v1.58.0/fortio_win_1.58.0.zip and extract `fortio.exe` to any location, then using the Windows Command Prompt:
```
fortio.exe server
```
Expand Down Expand Up @@ -128,7 +128,7 @@ Full list of command line flags (`fortio help`):
<!-- use release/updateFlags.sh to update this section -->
<pre>
<!-- USAGE_START -->
Φορτίο 1.57.5 usage:
Φορτίο 1.58.0 usage:
fortio command [flags] target
where command is one of: load (load testing), server (starts ui, rest api,
http-echo, redirect, proxies, tcp-echo, udp-echo and grpc ping servers),
Expand Down
2 changes: 2 additions & 0 deletions fhttp/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func HTTPServerWithHandler(name string, port string, hdlr http.Handler) net.Addr
ReadHeaderTimeout: ServerIdleTimeout.Get(),
IdleTimeout: ServerIdleTimeout.Get(),
Handler: h2c.NewHandler(hdlr, h2s),
ErrorLog: log.NewStdLogger("http2c srv "+name, log.Error),
}
listener, addr := fnet.Listen(name, port)
if listener == nil {
Expand Down Expand Up @@ -270,6 +271,7 @@ func HTTPSServer(name string, port string, to *TLSOptions) (*http.ServeMux, net.
IdleTimeout: ServerIdleTimeout.Get(),
Handler: m,
TLSConfig: tlsConfig,
ErrorLog: log.NewStdLogger("http srv "+name, log.Error),
}
go func() {
err := s.ServeTLS(listener, to.Cert, to.Key)
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.18
require (
fortio.org/assert v1.2.0
fortio.org/cli v1.3.3
fortio.org/dflag v1.5.2
fortio.org/log v1.9.3
fortio.org/scli v1.10.3
fortio.org/dflag v1.5.3
fortio.org/log v1.10.0
fortio.org/scli v1.11.0
fortio.org/testscript v0.3.1
fortio.org/version v1.0.2
github.com/golang/protobuf v1.5.3
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ fortio.org/assert v1.2.0 h1:XscfvR8yp4xW7OMCvNbCsieRFDxlwdEcb69+JZRp6LA=
fortio.org/assert v1.2.0/go.mod h1:039mG+/iYDPO8Ibx8TrNuJCm2T2SuhwRI3uL9nHTTls=
fortio.org/cli v1.3.3 h1:b2JPQ7ekVFpF7SrEllJTbh1rdivsyXT081oQUeiuIp0=
fortio.org/cli v1.3.3/go.mod h1:ZsevXTvMidh3xllYoAElS52XRcGx+f1hVlgB+v2Pa0Y=
fortio.org/dflag v1.5.2 h1:F9XVRj4Qr2IbJP7BMj7XZc9wB0Q/RZ61Ool+4YPVad8=
fortio.org/dflag v1.5.2/go.mod h1:ppb/A8u+KKg+qUUYZNYuvRnXuVb8IsdHb/XGzsmjkN8=
fortio.org/log v1.9.3 h1:rkgDmgF7dLfNRtVOE44Av5KBlro8FkpTKnTnphHy074=
fortio.org/log v1.9.3/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU=
fortio.org/scli v1.10.3 h1:6aNn9ggOAoyp9vDs3rXN3uMZiRHcVdlPbsTHoN8PfiE=
fortio.org/scli v1.10.3/go.mod h1:qfmKaJUtGumrCs0+CfErIFp2qjT2OV6BTBGXGgRqaY4=
fortio.org/dflag v1.5.3 h1:+pCqZBCz95PYTxhcmenjrkVORWIRB1Je4eO/So574Bc=
fortio.org/dflag v1.5.3/go.mod h1:cM/ojIzdDv8FRA5yqSRpDK9jCGmASln0k7ag3zeiqbw=
fortio.org/log v1.10.0 h1:Id2z9HjGlof0VsIHi2XNI9k+tG7ujODVDnAAvkSgpuE=
fortio.org/log v1.10.0/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU=
fortio.org/scli v1.11.0 h1:MI0kTivwCIF2L6eJJFUnTipd5d1KtCM1oVMB6Dcf6pY=
fortio.org/scli v1.11.0/go.mod h1:XfyQjPJWYlF74dY0zMascOzVPds0GCbam184DMuCySU=
fortio.org/sets v1.0.3 h1:HzewdGjH69YmyW06yzplL35lGr+X4OcqQt0qS6jbaO4=
fortio.org/sets v1.0.3/go.mod h1:QZVj0r6KP/ZD9ebySW9SgxVNy/NjghUfyHW9NN+WU+4=
fortio.org/testscript v0.3.1 h1:MmRO64AsmzaU1KlYMzAbotJIMKRGxD1XXssJnBRiMGQ=
Expand Down

0 comments on commit fef3d6d

Please sign in to comment.