unjs / ipx

🖼️ High performance, secure and easy-to-use image optimizer.
MIT License
1.53k stars 61 forks source link

Set options for https.Agent #88

Closed vitr-nindeco closed 1 year ago

vitr-nindeco commented 1 year ago

Anybody knows how can i set https.Agent options like "rejectUnauthorized" and "timeout" in IPXOptions{fetchOptions}? Agent creates in /src/sources/http.ts in function createHTTPSource.

vitr-nindeco commented 1 year ago

import https from "https";

const agent = new https.Agent({ rejectUnauthorized: false });

fetchOptions = { agent: agent }

const ipx = createIPX({ fetchOptions: fetchOptions });

export default createIPXMiddleware(ipx);