Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions content/docs/quic/qlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@ quic.Config{
}
```

## Redacting IP Addresses and Ports

By default, qlog logs IP addresses and ports in the following events:

* `transport:connection_started`
* `transport:parameters_set`

Applications can redact sensitive addresses by wrapping a connection tracer with `qlog.RedactIPs`:

```go
tracer := qlog.RedactIPs(
qlog.DefaultConnectionTracer,
func(addr netip.AddrPort, isLocal bool) (string, bool) {
if isLocal {
return "***", true
}
// Don't redact remote addresses.
return "", false
},
)
```

The callback receives the IP address and port, and a flag indicating whether the address belongs to the local endpoint. Returning `true` replaces the IP address with the returned string and omits the port; returning `false` preserves the original values. The example above only redacts local addresses.

## Events not associated with a Connection

When listening for QUIC packets on a UDP socket, there are a couple of events that can happen before an incoming packet can be associated with a QUIC connection. For example, the QUIC packet header might be invalid, forcing us to drop the packet. Or the server might be overloaded and reject a new connection attempt.
Expand Down
Loading