Copy the the file async_simple/demo_example/http/index.html to http server directory before run the http client, otherwise you will get 404 not found error message.
| 102 | // directory before run the http client, otherwise you will get 404 not found |
| 103 | // error message. |
| 104 | int main(int argc, char *argv[]) { |
| 105 | try { |
| 106 | asio::io_context io_context; |
| 107 | std::thread thd([&io_context] { |
| 108 | asio::io_context::work work(io_context); |
| 109 | io_context.run(); |
| 110 | }); |
| 111 | async_simple::coro::syncAwait(start(io_context, "127.0.0.1", "9980")); |
| 112 | io_context.stop(); |
| 113 | thd.join(); |
| 114 | std::cout << "Finished ok, client quit.\n"; |
| 115 | } catch (std::exception &e) { |
| 116 | std::cerr << "Exception: " << e.what() << "\n"; |
| 117 | } |
| 118 | } |