Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BadNetworkTypeErrCode uint = 1 BadHostPortPairErrCode uint = 2 BadIPAddressErrCode uint = 3 NotPublicIPAddressErrCode uint = 4 )
Functions ¶
func NewClient ¶
NewClient returns a pointer to an http.Client with some sensible defaults, plus a custon dialer control that checks the receiving IP address against a forbidden-list, and checks the network type against an allow-list. Both lists have sensible defaults that can be added to by means of the Options struct
Types ¶
type Options ¶
Options is a struct that can be passed into NewClient to override the default allow-list of network types and the default forbidden-list of ip addresses
type SafeHTTPError ¶
type SafeHTTPError struct { Err error Text string ErrCode uint // contains filtered or unexported fields }
SafeHTTPError is the error type returned by the SafeHTTPClient when an attempt is made to use a forbidden network type or IP address
func (*SafeHTTPError) Error ¶
func (err *SafeHTTPError) Error() string
func (*SafeHTTPError) Unwrap ¶
func (err *SafeHTTPError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.