{"id":546,"date":"2019-01-08T00:38:07","date_gmt":"2019-01-08T00:38:07","guid":{"rendered":"http:\/\/www.trapzz.com\/?p=546"},"modified":"2021-01-26T18:14:56","modified_gmt":"2021-01-26T18:14:56","slug":"simple-websocket-server-in-c","status":"publish","type":"post","link":"http:\/\/www.trapzz.com\/?p=546","title":{"rendered":"Simple Websocket Server in C++"},"content":{"rendered":"<p>Over the holiday break my interest in websockets was peaked when I watched my daughters play a javascript based multiplayer game <a href=\"http:\/\/slither.io\/\">http:\/\/slither.io\/<\/a>.  I couldn&#8217;t find a simple example (or any actually) of how to write a C\/C++ server which uses the websocket protocol.<\/p>\n<p>After a some digging, reading the RFC, etc. I decided to write my own as a test &#8211; it&#8217;s a very simple test &#8211; but it works and establishes a connection.  I posted it on github just in case someone else might be curious&#8230;it could save that person a couple of hours of header, sha, endian swapping headaches.<\/p>\n<p><a href=\"https:\/\/github.com\/mcferront\/simple_websocket\">https:\/\/github.com\/mcferront\/simple_websocket<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the holiday break my interest in websockets was peaked when I watched my daughters play a javascript based multiplayer game http:\/\/slither.io\/. I couldn&#8217;t find a simple example (or any actually) of how to write a C\/C++ server which uses the websocket protocol. After a some digging, reading the RFC, etc. I decided to write [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-546","post","type-post","status-publish","format-standard","hentry","category-general-code"],"_links":{"self":[{"href":"http:\/\/www.trapzz.com\/index.php?rest_route=\/wp\/v2\/posts\/546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.trapzz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.trapzz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.trapzz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.trapzz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=546"}],"version-history":[{"count":3,"href":"http:\/\/www.trapzz.com\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions"}],"predecessor-version":[{"id":730,"href":"http:\/\/www.trapzz.com\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions\/730"}],"wp:attachment":[{"href":"http:\/\/www.trapzz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.trapzz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.trapzz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}