最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I use use C++ to send data through a websocket? - Stack Overflow

programmeradmin2浏览0评论

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.

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.

Share Improve this question asked Jan 6, 2011 at 18:54 Amir RustamzadehAmir Rustamzadeh 4,5287 gold badges36 silver badges43 bronze badges 4
  • What is your OS and compiler? – Steve Townsend Commented Jan 6, 2011 at 18:59
  • Possible duplicate of: stackoverflow.com/questions/4147715/… – yasouser Commented Jan 6, 2011 at 19:00
  • @anand: I don't think websockets are quite the same as sockets. – Null Set Commented Jan 6, 2011 at 19:08
  • 1 It is however a possible duplicate of this: stackoverflow.com/questions/3916217/… – Null Set Commented Jan 6, 2011 at 19:10
Add a comment  | 

7 Answers 7

Reset to default 6

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.

Checkout Boost Asio library.

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.

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.

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.

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

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

发布评论

评论列表(0)

  1. 暂无评论