I am looking for an HTTP server in C/C++ that can take data from another application and send it over the network.

My basic motive is to create a command line application which takes a request type/id as input frmo the web server and generates an output which it gives back to the server and server sents it back as a responce to the request. This application that gives the server the output reads some files and generates the output using AI.

When the web server is accessed the, user never gets to know which file is being given to the application to check and generate output. They only receive certain output in their browser window depending upon what is generated by the application and sent over to them by the web server.

I'd also like server to be able to handle multiple connections.

Similarly, the server should also be capable of accepting data from the user and sent it back to the application. Say for example when we want to upload the files from browser and send it to the server.

I've been looking for a solution on the internet for a while now but didn't find anything.

It'd be great if there is an existing librairy to achieve this target, but I'm happy to code my own if possible. I prefer using C++, but the application should work fast, so performance is extremly important.

I've already coded most part of the application which reads an input file and uses AI to generate an output. I just need it to sent it over using HTTP.

So my question is how I can get the data generated by one application to be sent over a network using HTTP when requested? i.e., An HTTP requests come, the server calls the application with the request id and the application returns an output which server sents back as responce).

Update: I do not know about sockets, but would like to learn about them.
Update: My requirements are pretty straight forward. I need the server to be able to directly communicate with my other executable and generate a different output each time a request is sent.

Recommended Answers

All 3 Replies

You don't really need to write your own HTTP server, such as Apache2, to do all that. Just write client/server socket programs, then carefully design the commands you want the server to recognize and how to do file transfers.

What operating system do you plan to use? boost has os independent socket libraries. At my last job four of us wrote a similar program in about a year -- coding, debugging and testing.

You don't really need to write your own HTTP server, such as Apache2, to do all that. Just write client/server socket programs, then carefully design the commands you want the server to recognize and how to do file transfers.

What operating system do you plan to use? boost has os independent socket libraries. At my last job four of us wrote a similar program in about a year -- coding, debugging and testing.

I'm planning to use Linux, but I'd love my code to be cross platform. Does boost work on Linux or is it for Windows. I've never used boost librairy before.

Can you please point me to a reference where I can learn to code client/server socket programs?

As I said, boost is cross platform. Just use google and you will find lots of tutorials and help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.