eidheim / Simple-Web-Server

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
MIT License
2.62k stars 755 forks source link

questions about this library #177

Open mariasmo opened 6 years ago

mariasmo commented 6 years ago

Hi,

I have 4 questions basically(i am new to this library and would like to make a decision whether to use this library or some other library. Hopefully someone can answer my questions)

1) Does this library support websockets?

2) This is what I want to accomplish in my application. Basically users(from a mobile device - Android / iOS) will send an audio stream to the server, the audio stream is then passed on to my application where it is transcribed and the text is sent back to the client. Can I accomplish this using this library? Or is it an overkill?

3) Does this library have necessary API to integrate into a C++ application?

4) How many requests can this library handle? in thousands? Should I consider Proxygen? Any suggestions?

Thanks in advance for your responses.

eidheim commented 6 years ago
  1. Please see Simple-WebSocket-Server. The WebSocket implementation is quite different from a Web Server implementation, so I decided to keep the projects separate.
  2. Your task here sounds like it should be implemented using WebSocket
  3. Yes, this is the main reason why I created these libraries, and that people should not need to learn all the nuts and bolts of (Boost.)Asio in order to create such services using C++.
  4. The overhead of the libraries are very low. Just remember to do a release build (-O3) if you want serious speed.

Finally, Asio, and networking in general, is somewhat complex, and I do not think that someone has made the tests run successfully using MSVC yet. You should be fine though if you use GCC or Clang on a Unix-like system.

mariasmo commented 6 years ago

Hi eidheim,

thank you for your answers. i will look into the websocket server as you suggested.

thanks

SethHamilton commented 6 years ago

@eidheim is there an example anywhere of using Simple-Web-Server to upgrade a connection to WS using Simple-WebSocker-Server? That would be slick. Actually a client example would be slick too. I have use cases for receiving streaming data and re-streaming data back out to an endpoint.

eidheim commented 6 years ago

@SethHamilton you can have a look at https://gitlab.com/eidheim/desktop-stream that uses upgrade in order to have a web server and a websocket server share the same port.

I have never considered supporting upgrade on the client side, since the websocket upgrade is always initiated by the client if I'm not mistaken.

edit: desktop-stream moved to gitlab