httpreused

package module
v0.0.0-...-fbae24a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 3 Imported by: 0

README

httpreused

Usage

package main

import (
	"fmt"
	"net/http"

	"github.com/skaji/go-httpreused"
)

func main() {
	c := httpreused.Wrap(http.DefaultClient)

	for i := 0; i < 2; i++ {
		res, err := c.Get("https://www.google.com")
		if err != nil {
			panic(err)
		}
		reused := res.Header.Get("X-Connection-Reused")
		ip := res.Header.Get("X-Connection-IP")
		fmt.Println(i, ip, reused)
	}
}
❯ go run main.go
0 172.217.26.36 false
1 172.217.26.36 true

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(c *http.Client) *http.Client

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL