Open renanyoy opened 7 years ago
You can specify timeout inside options for http request. Here is exaple from my code (I use some typescript here)
import * as icy from 'icy'; import * as http from "http"; import { URL } from "url"; let url = new URL("http://www.someurl.com"); let icyRequest = icy.get({ protocol : url.protocol, hostname: url.hostname, path : url.pathname + url.search, port: url.port, headers: { "Connection" : "close" }, agent: false, timeout: 1000 }, (res) => { res.once('metadata', (metadata) => { let songTitle = icy.parse(metadata).StreamTitle; }); });
how I can modify the request timeout for icy ?