Category : websocket

I have a cpprestsdk package and using to connect and stream data from some endpoint. using namespace web; using namespace web::websockets::client; websocket_client clientbtcusdt; clientbtcusdt.connect(std::wstring(L"wss://stream.binance.com:9443/ws/" + std::wstring(L"btcusdt") + L"@[email protected]")).wait(); clientbtcusdt.receive().then([](websocket_incoming_message in_msg) { return in_msg.extract_string(); }).then([&](std::string body) { Json::Value json; std::string parsingError; std::stringstream streamResponse(body); Json::parseFromStream(Json::CharReaderBuilder(), streamResponse, &json, &parsingError); std::cout << json << std::endl; }).wait(); This receives one ..

Read more

I wrote a simple game in C++ as a hobby, and would like to create a web-interface. I have gotten WebSocketPP to work for this, but now would like to allow multiple instances of the game to be run at once. I created a simple test server that is a fusion of the examples https://github.com/zaphoyd/websocketpp/blob/master/examples/echo_server_tls/echo_server_tls.cpp ..

Read more

I am working on a project to write a plugin, using websocketpp to support web socket connections.  The main system process will fork a child process and that child will wait (a short wait) until the parent tells that child to perform a task.  The main system code uses asio and the parent process already ..

Read more

I am trying to connect to a secure websocket using asio. This example will work for an ip address: #include <iostream> #include <asio.hpp> int main() { asio::error_code ec; asio::io_context context; asio::io_context::work idleWork(context); asio::ip::tcp::endpoint endpoint(asio::ip::make_address("51.38.81.49", ec), 80); asio::ip::tcp::socket socket(context); socket.connect(endpoint, ec); if (!ec) { std::cout << "Connected!" << std::endl; } else { std::cout << "Failed to ..

Read more

im trying to include websocketpp in my c++ project, I have everything included correctly like VC Directories etc & all that. And i just keep getting errors. It even gives me some errors in some of the windows header files. If anyone could help, that would be amazing. Thanks! //how im including #include "external/websocketpp/config/asio_no_tls_client.hpp" #include ..

Read more