Skip to content

Instantly share code, notes, and snippets.

@findkim
findkim / client_test.md
Created December 8, 2020 17:24
Test Consul API client reuses TLS connection

The test below captures concurrent and serial requests using the Consul API client. It reveals that a new connection is established for concurrent requests. Once a pool of connections are established, subsequent serial requests reuse those existing connections.

package client_test

import (
	"context"
	"log"
	"net"
	"net/http"

Keybase proof

I hereby claim:

  • I am findkim on github.
  • I am kimngo (https://keybase.io/kimngo) on keybase.
  • I have a public key ASDB0FNyPj0wlVZfQ9l1taEO_TGT7FfncMnuV9JsPyjxmgo

To claim this, I am signing this object: