Skip to content
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

Support specifying cookies in the faraday connection #45

Closed
knewter opened this issue May 9, 2013 · 3 comments
Closed

Support specifying cookies in the faraday connection #45

knewter opened this issue May 9, 2013 · 3 comments

Comments

@knewter
Copy link
Contributor

knewter commented May 9, 2013

What are your thoughts on adding an API to allow one to set cookies on the connection?

Here's the use case - we had three people running a bit of code that's a big heavy on the mt. gox api. Mt. Gox uses "I'm Under Attack Mode" with CloudFlare. An undocumented feature of that mode (or at least I couldn't find it, but #mtgox channel mentioned it) was that if CF thinks you're DDoSing they'll flip a bit on your IP and require you to perform a javascript-based unit of work, set a cookie in your browser, and then let you in.

As it stands, from one IP we have to send a given cookie across or our API calls fail. I've got a monkeypatch in place in my project right now to support adding cookies into the header (in both get and post requests), but it seems like it could come up for other users of your API client as well.

@knewter
Copy link
Contributor Author

knewter commented May 9, 2013

I'm also going to be writing a (horrendous) headless webkit client in my app that catches this error if it occurs, performs the in-browser unit of work headless, sets a configuration option in a file and replaces the in memory cookie, on the off chance that this happens again. That's not terribly relevant to this ticket, but it's also not likely something I'll open source for fear that it would upset CloudFlare, etc.

I'm not DDoSing them, at all, and actually have relatively normal looking API usage, but we have a tool that fetches the history for all time to bootstrap a database table full of mt. gox trades, and when a new dev came on board and bootstrapped his environment while two of us were also hitting the api fairly heavily, cloudflare laid down the hammer.

@sferik
Copy link
Owner

sferik commented May 12, 2013

If you put the code into a pull request, I'll review it.

@knewter
Copy link
Contributor Author

knewter commented Jul 27, 2013

So for my use case, this wasn't nearly as useful as it appeared 3 months ago. I'll close it (I implemented it, but it was Not Pretty and I removed it).

@knewter knewter closed this as completed Jul 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants