-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does needle support dns failovers? #198
Comments
No it doesn't. We'd need to hack some low-level Node.js internals for that, wouldn't we? |
@tomas Not really. They've now introduced an option in their |
@ScionOfBytes Interesting Idea. Any idea what the API for this might be? My opinion is usually "if it's possible to do it elsewhere, keep it out of needle", but in this case it's something that has to be integrated into the API. Lately I've been debating whether it's worth the headache to migrate node-osmosis to something other than needle. This feature might give me reason to stay on needle. It'd probably be a good feature to have on production web scrapers. |
My opinion is pretty much the same as @rchipka's (to keep needle nimble), but if this might help make it more robust and less prone to dns lookup errors, I'm all for it. I'll dive into this later or tomorrow and see if it can be implemented in a clean way. |
@rchipka Ideally this wouldn't need a change in the API as failovers would be handled behind the scenes. Since node introduced the When this flag is passed, needle passes the There's a discussion (now closed) on nodejs/node#708 about this issue and how to handle errors returned from multiple ip tries is something of a concern (nodejs/node#708 (comment)) and this (nodejs/node#708 (comment)) seems like a way to go. From the point of view of the client, there should only be one server and not multiple ones to worry about. And only if all of them fail should the client even be concerned about handling errors. |
Ok, I just wrote an initial implementation here. You can pass a So far it seems to work pretty well. Check it out and let me know what you think. |
@tomas Will test ASAP and report results. |
Great, thanks!
…On Wed, Jan 25, 2017 at 8:05 AM, Shaun ***@***.***> wrote:
@tomas <https://github.com/tomas> Will test ASAP and report results.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#198 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAApTl-DwcqnbkuqTHRfhtxZZqazcIwlks5rVyx5gaJpZM4Lmzvq>
.
--
Fork Ltd.
forkhq.com
|
ping @ScionOfBytes ! |
Node http does not and neither does request. Does needle have a way to handle dns round-robin failover and try all ips?
The text was updated successfully, but these errors were encountered: