Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultClient *http.Client
)
DefaultClient is the default Client whose setting is the same as http.DefaultClient.
Functions ¶
func NewClient ¶
NewClient returns a new http.Client configured to be paranoid for attackers.
This also returns http.Tranport and net.Dialer so that you can customize those behavior.
func NewDialer ¶
func NewDialer(dialer *net.Dialer, opts ...Option) func(ctx context.Context, network, addr string) (net.Conn, error)
NewDialer returns a dialer function which only accepts IPv4 connections.
This is used to create a new paranoid http.Client, because I'm not sure about a paranoid behavior for IPv6 connections :(
Types ¶
type Option ¶ added in v0.2.0
type Option func(*config)
Option type of paranoidhttp
func ForbiddenHosts ¶ added in v0.2.0
ForbiddenHosts set forbidden host rules by regexp
func ForbiddenIPNets ¶ added in v0.2.0
ForbiddenIPNets sets forbidden IPNets
func PermittedIPNets ¶ added in v0.2.0
PermittedIPNets sets permitted IPNets It takes priority over other forbidden rules.
Click to show internal directories.
Click to hide internal directories.