Closed Jelmerro closed 1 year ago
Never tried to force IPV4, could you possibly PR this?
Sorry, I don't have a clue where this is breaking, I can see the url being correct, and all the parameters too, but then the actual request translates the url to an IPV6 address and then everything breaks. This is not my expertise sadly, but I did notice a pattern, because if I disable IPV6 it works flawlessly again.
Seems like this is an issue upstream as well, but no solution to be found so far: https://github.com/nodejs/undici/issues/1413
Seems like this is an issue upstream as well, but no solution to be found so far: nodejs/undici#1413
That's one hell of a weird issue.
const dns = require("dns")
dns.setDefaultResultOrder("ipv4first")
Adding the above seems to fix it for now, and apparently they are working to make this better in NodeJS 20. Sorry wasting your time on this issue when it was not a problem of your project but in NodeJS/undici.
where can i put that ?
Both the scraping and the regular API stop working when a device supports IPV6:
The api url is converted to an IPV6 address instead of the working IPV4 one, could we have an option to always use IPV4 for the API?