New creates a new runner with the provided options.
(options *Options)
| 21 | |
| 22 | // New creates a new runner with the provided options. |
| 23 | func New(options *Options) *runner { |
| 24 | http.DefaultClient.Transport = &http.Transport{ |
| 25 | TLSHandshakeTimeout: options.Request.Timeout, |
| 26 | TLSClientConfig: &tls.Config{ |
| 27 | InsecureSkipVerify: options.Request.InsecureSkipVerify, |
| 28 | }, |
| 29 | } |
| 30 | http.DefaultClient.Timeout = options.Request.Timeout |
| 31 | |
| 32 | return &runner{ |
| 33 | Options: *options, |
| 34 | Results: make(chan url.URL), |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // Run starts processing the inputs and extracts JavaScript sources into the runner's Results channel. |
| 39 | func (r *runner) Run() error { |