Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFailedToCreateParser = customerror.NewFailedToError("create PAC parser", "", nil) ErrFailedToFindParserNil = customerror.NewFailedToError("PAC parser isn't initialized", "", nil) ErrFailedToFindURL = customerror.NewFailedToError("find URL", "", nil) ErrFailedToParseURI = customerror.NewFailedToError("parse URI", "", nil) ErrInvalidParams = customerror.NewInvalidError("params", "", nil) )
Functions ¶
This section is empty.
Types ¶
type PACProxies ¶
type PACProxies = []PACProxy
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser definition.
func New ¶
New is the Parser factory. It's able to load PAC from many sources: - Direct: `textOrURI` is the PAC content - Remote: `textOrURI` is an HTTP/HTTPS URI - File: `textOrURI` points to a file:
- As per PAC spec, PAC file should have the `.pac` extension
- Absolute and relative paths are supported
- `file://` scheme is supported. It should be an absolute path.
Notes:
- Optionally, credentials for each/any proxy specified in the PAC content can be set (`proxiesURIs`) using standard URI format. These credentials will be automatically set when `FindProxy` is called.
- URI is: scheme://[credential]@host[/path]` where:
- `credential` is `username:password`, and is optional
- `host` (also known as `authority`) is `hostname:port`, and is optional.
Click to show internal directories.
Click to hide internal directories.