spacetraders-v2
posts
links
Burnt a couple of nights chasing this one. Node was throwing ETIMEDOUT AggregateError when hitting https://api.spacetraders.io/v2 even though curl to the same address had no issue. Turns out node attempts resolve ipv6 first, and in the case of SpaceTraders API ipv6 can be resolved but the API doesn’t support it, however, the resolution time goes over 250ms from Australia to wherever it’s hosted, throwing ETIMEDOUT. The solution is to:
jsnet.setDefaultAutoSelectFamilyAttemptTimeout(500)
Some helpful SpaceTraders API links: