Amir Rustamzadeh
Amir Rustamzadeh

Reputation: 4528

How can I use use C++ to send data through a websocket?

I want to be able to send data over a websocket in my C++ code? Is there some library or standard way that this is done? Thanks for the help, I appreciate it, and please let me know if I should provide more information.

Upvotes: 9

Views: 14140

Answers (7)

W1M0R
W1M0R

Reputation: 3626

Beast is a C++ library using Boost Asio, demonstrated at CppCon 2016 and used in rippled, an open source server application that implements a decentralized cryptocurrency system.

Also see this related question and this one.

Upvotes: 1

Ole
Ole

Reputation: 121

For a pure C++ approach to WebSockets using Boost.Asio check out: https://github.com/eidheim/Simple-WebSocket-Server

Upvotes: 0

Michael Hilbert
Michael Hilbert

Reputation: 256

Please have a look at https://github.com/zaphoyd/websocketpp, which is based on Boost ASIO.

You can find a comparison of websocket implementations at http://en.wikipedia.org/wiki/Comparison_of_WebSocket_implementations.

Upvotes: 6

MKroehnert
MKroehnert

Reputation: 3737

Check out the link to libwebsocket in the answer of warmcat to my question (Standalone C++ websocket server library) which was posted earlier.

Note that libwebsocket can be used for client and server side websockets.

Upvotes: 1

Nim
Nim

Reputation: 33655

cURL is probably going to be a little bit more highlevel and easier to use than boost, esp if this is HTTP you are looking at.

Upvotes: 1

yasouser
yasouser

Reputation: 5177

Checkout Boost Asio library.

Upvotes: 3

Charlie Martin
Charlie Martin

Reputation: 112366

Lots of different ones, but you'd probably find the Boost libraries helpful.

Upvotes: 0

Related Questions