ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I'm trying to add HTTP authentication to my app (it's a rss reader). As the app is in written in C and uses Libxml2, I've been searching in Libxml2 doc, but it seems it's not possible. Maybe someone could point me to a link to relevant info about how I could achieve that?
Thanks.
2. HTTP authentication is supported automatically by most servers (certainly by Apache and IIS), and most browsers (IE, Firefox, Safari, etc etc). So it's a "given" that most web servers and most web clients will probably be able to negotiate HTTP Authentication.
Sooooooooo .....
3. If your C/libXML2 application runs completely independent of any web server (if it opens its open sockets and listens on its own port), you'll probably have to "roll your own" authentication mechanism. It isn't hard - the Wikipedia link above should get you pointed in the right direction.
4. If (as is more likely) your application is invoked by a standard web server (e.g. it's called from an HTML web page served by an Apache server) - then it's REALLY easy. You just write an .htaccess file for the directory with your HTML.
In my app, the user enter a RSS feed URL. Then this URL is processed first by libXML2, which is reponsible for downloading and parsing the remote resource. So, the app doesn't deal directly with socket. It only passes the URL to libxml2 then get a downloaded file.
So, if I'm right, it could be enough to just pass a string like, for instance: "http://" ( "user : password" ) base64-encoded @ "rss-news.com/feed1.xml" to libxml2.
If I may ask another question, I'd like to add proxy server support too. I could find a lot of doc on proxy server itself but not on how applications can implement that.
Thanks again.
Yes, the user selects a feed URL, then the URL is passed to libxml2 which downloads and parses it. It's a client application. What I wanted to know is how proxy server info (host name and port number) is supposed to be used/sent by the app. I just read about suffix proxy where proxy info is passed in the URL.
From your answers and after more search, everything I need is documented in the HTTP protocol so I'm going to do that with socket programming. Thanks paulsm4 and sundialsvcs.
Last edited by manu-tm; 06-15-2011 at 07:25 AM.
Reason: solved
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.