Remote control of a C ++ program in Ubuntu 12.04 over HTTPS

I have an emulator program written in C ++ running on Ubuntu 12.04. There are some parameters and parameters required to run the program, which are specified by the main arguments. I need to request and manage these parameters over HTTPS from a remote computer / mobile device. I was wondering if anyone can help me with this.

There might be some libraries for convenience, like libcurl. I'm not sure how much this works for my case, but here is an example of a connection in libcurl. It is not necessary to use any libraries; just the most efficient / easy way.

#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>


using namespace curlpp::options;

int main(int, char **)
{
    try
    {
        // That all that is needed to do cleanup of used resources (RAII style).
        curlpp::Cleanup myCleanup;

        // Our request to be sent.
        curlpp::Easy myRequest;

        // Set the URL.
        myRequest.setOpt<Url>("http://example.com");

        // Send request and get a result.
        // By default the result goes to standard output.
        myRequest.perform();
    }

    catch (curlpp::RuntimeError &e)
    {
        std::cout << e.what() << std::endl;
    }

    catch (curlpp::LogicError &e)
    {
        std::cout << e.what() << std::endl;
    }

    return 0;
}

      

0


source to share





All Articles