C/C++ HTTP Client Library for Embedded Projects [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
The community reviewed whether to reopen this question 9 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
So I have trawled through pages and pages of search results on StackOverflow and Google and I have come across very few C/C++ HTTP client libraries suitable for a resource-constrained, embedded environment (e.g. an ARM). I have however come across quite a few that are suitable for desktop-class applications.
Essentially, I am after a simple, easy-to-use and convenient API to make HTTP GET, POST and HEAD calls (with support for authentication, download resume and payload compression). It would be ideal if it had a small footprint (i.e. no or minimal external dependencies) and is open-source (with a permissive license).
Here's a list of what I've come across so far and why they are not suitable -
curl - too heavyweight
poco - too heavyweight
neon - GPL
qlibc - relies on POSIX libraries
cpp-netlib - relies on Boost libraries
serf - relies on the Apache Portable Runtime library
urdl - relies on Boost libraries
HTTP Client C API - promising but requires a C++ wrapper
Are there any libraries out there that I am unaware of or am I better off rolling my own?

Have you taken a look at the HTTPClient on mbed? Looks like there are lots of forks of an original from a few years ago that wasn't maintained. I haven't used this...
http://mbed.org/users/WiredHome/code/HTTPClient/

I can just describe what I used for those tasks.
curl - if you are lazy, you can just download in built binary and have nothing to do more, it has very simple headers and a lot of examples. You will need 3-4 already built libraries and header. With no external dependencies. So, I would count it as too low-level, but not heavyweight at all.
boost.asio - very interesting paradigm of realization, quite easy and clean. But I would say it is low-level too. Harder then curl. And needs to use boost, that is external dependency you want to avoid, I guess.
poco - best solution for http server. It's high level, after you joined it to your application, you just need to implement few virtual functions, having all other work (and thread management) done. Poco gives a lot of stuff for application management, thread/process management and it is very simple and easy, I would even say it has java-like interface. Yes, there is external dependency to poco, but I would look at this as a chance to learn perfect library. Still, for http clients it is really heavy.
That is all my C++ experience with HTTP. Counting you need just client and don't need dependencies, I would offer you to look at libcurl library. It's cross-platform, easy, no dependencies and low-level enough to get all you need with network. And if you will have time - look at Poco, really, I believe you will fell in love with this library as I did.
Hope that will be helpful.

I found another one, which just needs to be packed into a lib.
didn't test it, but may be worth a look:
https://github.com/reagent/http.git

Related

C++ Core Application Development framework , Open Source , Cross Platform [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Like Qt , do we have any core application development framework in c++.
I think the qt is mainly for GUI applications . I need something other than QT , which gives a much faster running code ...
Visual Studio for c++ is a good choice , but its not an open source and cross platform one ..
To put it bluntly, to me it sounds like you're wasting your time and do not have clearly defined goal for your application. No framework can fix this problem. Write down application specification, list of target platform, check what functionality is required but missing, search for existing libraries, then use them.
I think the qt is mainly for GUI applications
You're mistaken.
In Qt 4 GUI component is optional. You are free to design console applications using QCoreApplication instead of QApplication for application object. As a bonus you get access to some GUI-related classes (not all of them, though - many require QApplication).
which gives a much faster running code
Making code run fast is your responsibility. If it runs slowly, then it is your fault until proven otherwise. Qt 4 is very fast, at least as far as GUI performance is concerned. Poor selection of algorithms, abuse of memory allocation routines and many other things can negatively impact performance. Switching to different framework won't fix those. Instead of searching for different tool, profile your code, search for bottlenecks and fix them.
Visual Studio for c++ is a good choice
It is not cross-platform. It is also not a framework - only IDE+compiler.
Cross Platform
Depending on your application you could even develop cross-platform application in standard C++ without any frameworks while using CMake/Scons/Autotools for build process. Unix-like environments have POSIX standard they more or less attempt to conform to, which can be used (on windows it requires cygwin/msys to be functional). Aside from that there's Boost. You could even ditch C++ and switch to scripted language to ensure portability. It all depends n your goals. Since you haven't said what you're writing it isn't possible to recommend anything specific aside from Boost. In addition to boost there are several frameworks (wxWidgets, Fox Toolkit, GTK) that may or may not meet your requirements.
Since it is not exacly clear what you mean by framework you might want to clarify that a bit more. Anyways, I am a happy user of boost as libraries for generic functionality and use eclipse + cdt as IDE to do coding and debugging. Boost, eclipse and the cdt are open source and cross-platform.
Which features should have the framework? How about the BOOST? It's not a framework as QT and wxWidgets, but it has a lot of features like delegates aka signals, threads, inter-process communications, network, etc.

Looking for a High Level C++ SSL Library [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I checked out quite a few SSL librarys tonight. OpenSSL looks good but lacks documentation, as most of them do. I thought I hit the jackpot when I found NetSieben's SSL C++ Library (http://www.netsieben.com/products/ssh/index.phtml) but after hours, I am unable to get it to compile. It says it needs Botan's lib, but absolutely no information how to link it to Botan or anything.
So I am looking for a fairly easy to use SSL library. I am just using it for a client application to connect to an already existing server.
To give a more thorough answer: There are a number of SSL libraries that are better documented than OpenSSL, which is notoriously bad.
If you look at the grand picture, the real alternatives as an SSL library are Botan, PolarSSL, Mozilla NSS, Wolf and GnuTLS.
All except Botan are not C++ specific so they do not have nice C++ objects and resource management.
My personal preference for SSL library is PolarSSL, because of the readability of the code, in-header API documentation and just general good experiences with it. It is used in some large FOSS projects and they have some kind of government accreditation.
I'm not a real fan of the wrappers like Boost.Asio as they still lack the proper documentation for the more in depth things. Boost.Asio itself is quiet ok and the examples are pretty decent though. If you only need a simple client, this might be the way to go.
Mozilla NSS is one of the older ones, but it does not support the newer TLS 1.1 and TLS 1.2 standards, which they actually should.
Both Botan and CyaSSL are good alternatives too. Botan documentation is thorough on some parts and perhaps a bit lacking on other parts, but some large open source projects include Botan and have good experiences with it.
In general, you can do a lot better than OpenSSL with any of these.
Hope this helps!
Boost.Asio provides SSL capabilities by wrappering OpenSSL. The examples are fairly straightforward, for client-code it looks something like this
ssl::context ctx(my_io_service, ssl::context::sslv23);
ctx.set_verify_mode(ssl::context::verify_peer);
ctx.load_verify_file("ca.pem");
ssl::stream<ip::tcp::socket> ssl_sock(my_io_service, ctx);
ip::tcp::socket::lowest_layer_type& sock = ssl_sock.lowest_layer();
sock.connect(my_endpoint);
sock.handshake();
sock.write(...);
note there are asynchronous methods async_connect and async_handshake and async_write too.
For a simple well-documented SSL library, you could look at https://polarssl.org.
PolarSSL has full API documentation and example clients on its source page.
Disclaimer: I'm the lead-maintainer for PolarSSL
Mozilla NSS is a relatively better documented set of libraries.
You might like CyaSSL, which is another SSL implementation. You can download it at http://www.yassl.com.

LDAP c++ API choice [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I would like to write my own LDAP client under Linux, specific to our local environment. Most probably I will use QT4 to provide a shiny frontend without much hassle.
I found that there seems to be no standard C++ library for this. OpenLDAP provides a C API and there should also be a C++ API (experimental?) somewhere..
Do I need to use the C stuff or is there a C++ API out there worth of recommendation?
I've actually written a C++ wrapper for OpenLDAP's C API for my day job and it wasn't my most enjoyable experience.
I didn't find a suitable C++ wrapper out there for my purposes (this was in 2006 so things may have changed since). I wound up directly interacting with the C api, which wasn't terrible but it does have some oddities. Assuming you go to the C/OpenLDAP route I can offer you a couple of tips.
Something that I found a little weird, the C API is defined in RFC1823 which means that pretty much every library has the same API.
In the case of OpenLDAP however a number of the RFC1823 API calls have been deprecated, particularly around the authentication parts. Depending on who distributed your OpenLDAP library and what version it is will determine if these deprecated functions have been disabled.
The main changes to avoid the deprecated API are switching from ldap_init() and ldap_open() to ldap_initialize() and using ldap_sasl_bind() (which confusingly handles all types of auth)
I found following c++ wrapper useful. Open Source C++ wrapper
This question is not easy to answer without knowing specifics of libraries you need.
I would say if C++ library based on Qt and available in source code - that'd be the front runner for sure. And if C++ library depends on some other not-Qt framework - don't even try to mix it with Qt.
C-based libraries generally have less dependencies, though a bit awkward and require more attention to details (initialization / deinitialization) comparing to C++ (destructing class usually means releasing all tied to it resources).

Cross platform Networking API [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I was wondering if there was an API to do networking that would work on Windows, Mac and Linux. I would like to make a card game that 2 people can play through a TCP connection.
There are a few options for this, some easier to use than others:
APR (Apache Portable Runtime) - Very popular. Quite easy to use. Includes lots of additional features handy for network programming (threads, mutexes, etc.)
ACE - Popular among the embedded space. Personally, I found it quite a complicated API, and not very straightforward to use.
Boost - If you have a decent level of sophistication with C++ (templates, metaprogramming, etc.), then Boost libraries are generally very good. I'm not sure how popular the Boost asynchronous networking libraries are in the real world.
QT - Popular as a UI toolkit, but has a great set of threading, event management, networking libraries. IMO, this is by far the easiest to use.
It's important to stay away from using the berkeley sockets library, as the implementations across operating systems vary wildly, and you'll lose a fair bit of time to tuning them as you port your software across OSs.
My personal preference: APR.
most of the berkeley sockets api works everywhere.
You can use ACE or Boost.Asio:
About ACE:
Increased portability -- ACE components make it easy to write concurrent networked applications on one OS platform and quickly port them to many other OS platforms. Moreover, because ACE is open source, free software, you never have to worry about getting locked into a particular operating system platform or compiler configuration.
About boost:
Boost.Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach.
The NRL has a really great library of networking methods that supports a large variety of platforms. They have excellent support from the actual developers on their mailing lists as well.
Protolib
For this simple application you can use the standard "Berkeley socket" functions that are mostly portable. You can also use Boost's abstractions.
If you needed security functions like SSL/TLS (which you don't need for a simple game I guess), there are open source libraries like OpenSSL, GNU TLS, Mozilla NSS.
I've got a feeling the Apache Portable Runtime might help with what you're looking for. Apache HTTPD used this library internally to abstract its platform-specific code so that the server code focuses on the logic and calls the methods in the APR and these translate to underlying operating system functions.
Of course, it might have more tools in it than you strictly need...
Synapse is good multiplatform network library. Open source and very easy to use.
http://www.ararat.cz/synapse/doku.php/download
SDL Net is a very simple abstraction layer on top of sockets, that's very easy to use. See http://www.libsdl.org/projects/SDL_net.

Good free FTP Client Library (for Windows C++ commercial apps)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for a good open source Windows FTP client library with a public domain or BSD-type license. Something that I have access to the source code and I can use it from C++ for Windows applications in a commercial app.
We have used Wininet for years and it's buggy and horrible. The last straw is the IE8 beta 2 contains a new bug in InternetGetLastResponseInfo(). I can no longer justify using Wininet when our users can install the latest version of IE and break our app.
I have looked at libcurl but it is way too heavy for our needs. The only thing I need is FTP support. I could spend a day stripping out all the code in libcurl I don't need, but I'd rather just start with a nice simple FTP client library, if possible.
I looked at ftplib (http://nbpfaus.net/~pfau/ftplib/) but it's GPL and I need this for a closed-source commercial app.
I've written FTP client code before, it's not that hard (unfortunately it was 15 years ago and I don't have the source code anymore). There must be a nice simple free client library that does nothing but FTP and has a license that can be used in closed-source commercial apps.
(If you are curious, the bug is that if you attempt to FtpFindFirstFile() with an FTP site where you can't make a passive-mode connection, InternetGetLastResponseInfo() doesn't return the full response. This is just one of many bugs I've found over the years. Another is that Wininet's FTP support ignores all timeout values. That particular bug has existed for years.)
You need Ultimate TCP/IP which is now free!
http://www.codeproject.com/KB/MFC/UltimateTCPIP.aspx
You get FTP. HTTP, SMTP, POP and more.
You won't regret it.
I have used libCurl to very good effect. The only disadvantage is that, to my knowledge, there is no support for parsing directory information that comes back from FTP servers (apparently, there is no standard directory format).
Checkout filezilla server for windows.
Are you looking for a command-line interface or an API? You may be able to adapt the feature-rich wget to your needs. Otherwise, take a look at http://www.sourceforge.net for lots of options.
This is the best FTP library I know: Kira's FTP Library, you can download it at: http://kirarelease.altervista.org/Home/index.html
Pass with the mouse above the box, you will understand why I like it so much: The code is the simplest I've found til now :)