()
| 38 | } |
| 39 | |
| 40 | function run() { |
| 41 | if (http.get) { // HTTP or HTTPS |
| 42 | if (options) { |
| 43 | http.get(url, options, request); |
| 44 | } else { |
| 45 | http.get(url, request); |
| 46 | } |
| 47 | } else { // HTTP/2 |
| 48 | const client = http.connect(url); |
| 49 | client.on('error', () => {}); |
| 50 | request(client.request(), client); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | run(); |