-
Notifications
You must be signed in to change notification settings - Fork 284
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
Added HTTP Client Proxy Support with Basic Authentication #731
Conversation
The settings will allow to configure some perks like a CookieJar and redirect follower. I haven't figured out where the connection timeout is though. |
Looks good so far, except for the Json workaround commit, which should be removed (hopefully being solved already anyway, but sanitizing UTF at that point wouldn't generally be a good idea). About |
All should be cleaned up now, I'm wondering if you'd agree (for the next pull request) to have a
Which forces every function in my webInterface to have req and res parameters. I've been using this to enable my own persistent https://gist.github.com/etcimon/86eee4cd50eecde24df4 I'd make one for The goal would be to expose just a |
I think that What you do there with the persistent session var or redis vars, IMO, is the job of the |
|
||
@property string proxyURL() const { | ||
return proxy.toString(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really just call it URL proxyURL;
and remove the property altogether. URL
could maybe get an assignment operator that takes a string, but writing settings.proxyURL = URL("http://..");
also isn't really that bad. But this kind of trivial convenience wrappers is generally discouraged in the code (it blows up the API too much).
Apart from the naming/property issue, looks good to merge. I'd also slightly refactor how the |
Revert Json Exception handling Added HTTP Status Errors, removed proxy settings class Fix assertion failure on empty proxy URL Added a default settings object and lessened the interface of HTTPClientSettings
Having a default object removes a lot of useless
Yes, decoupling with a function in
A This would be most useful for
of course a utility function could be made that interacts only with the cookies to build a session ID but it won't be of any use if you agree on this concept being implemented |
Giving it some more thought, I think there should be a trait
|
I'll need to think about the session support some more (my plan is to use Redis as a session store now, so I'll have some time to actually play with that stuff). BTW, forgot to merge... |
Added HTTP Client Proxy Support with Basic Authentication
This is how I'm currently doing it: https://gist.github.com/etcimon/324f4c79c49b10f67610 This has some variables as global. It would be nice to segment them in the web interfaces but I think this would require some dependency injection as well (see #739), the only way to make this work with a mix of different www. domains / websites currently is to recompile it with different settings. We should only need to decide if it must be in a separate library for now. ie. I was intending on having domain-specific callbacks in the web interfaces, e.g. |
Here's how the proxy client works:
Where
192.168.2.50
has a remote squid proxy server installed and running on port 3128, with the configuration as specified here:http://howtonixnux.blogspot.ca/2008/03/squid-with-password-authentication.html
to find the htpasswd command, I had to run
yum provides \*bin/htpasswd
, andncsa_auth
on my server was calledbasic_ncsa_auth
.