-
Notifications
You must be signed in to change notification settings - Fork 79
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
Custom HTTP/S agents #91
Comments
This answer applies to both this and #92: I think we'll have to split Affjax's interface from its implementation if we want to support non-browser-XHR features, perhaps using https://github.com/slamdata/purescript-affjax-algebra or a typeclass or something. I don't really have time to work on it myself right now though. Sorry about the slow reply! |
I am interested in investing time into that. What method (typeclass, free monad) would be preferred and more importantly why? Is there another approach? |
I guess since the algebra is already done just writing an alternative interpreter for that would be the fastest way to get this working, so I'd probably go with that. The typeclass approach might be slight easier to defer to the But generally I prefer the f-algebra approach as it gives you more options: you can (more easily) inspect or modify the requests, there is more flexibility in how the interpreter is implemented (in terms of accepting options, etc.). Also I prefer to avoid lawless typeclasses. Either option is pretty good really, it's aesthetic as much as anything else. And you can even mix the two. |
xhr2 allows using a custom http/s agent for node: https://github.com/pwnall/node-xhr2/blob/567ec5f41f94f0bcb6d6b1f917be6506f43ce49a/src/001-xml_http_request.coffee#L262-L265.
It would be great if this could be set somehow, but not sure how this fits with purescript.
My usecase is wanting to plug in a proxying agent.
The text was updated successfully, but these errors were encountered: