{"id":720,"date":"2017-09-20T12:57:41","date_gmt":"2017-09-20T17:57:41","guid":{"rendered":"http:\/\/sunapi386.ca\/wordpress\/?p=720"},"modified":"2017-09-20T12:57:41","modified_gmt":"2017-09-20T17:57:41","slug":"websocket-socketio-rant","status":"publish","type":"post","link":"https:\/\/sunapi386.ca\/wordpress\/websocket-socketio-rant\/","title":{"rendered":"Websocket Socketio Rant"},"content":{"rendered":"<p>Websocket Socketio Rant<\/p>\n<p>I learned that websocket is not the same as socket.io. While this may seem obvious in hindsight, I wasn&#8217;t aware I was using socket.io until I spent a long time trying to figure out why I couldn&#8217;t use websocket (ws:\/\/) protocol to connect to my (http:\/\/) server, which used socket.io to handle websocket connections. Socket.io is built on top of the websocket protocol, but also supports old, non-websocket-supporting browsers. I was setting up a simple Python Flask webserver, and was using Flask Socketio. I thought they were one and the same.<\/p>\n<p>Another thing I found is, as of now (Sept 2017), there are poor support for python socket.io clients. Of about the only two python packages I found to handle socketio, there seems to be many inconsistencies in the library function and I couldn&#8217;t predict the behaviour of what it was supposed to do. After many hours of fussing about, I switched to C++ socketio library (sio_client.h). And it works very well, I got it to work quickly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Websocket Socketio Rant I learned that websocket is not the same as socket.io. While this may seem obvious in hindsight, I wasn&#8217;t aware I was using socket.io until I spent a long time trying to figure out why I couldn&#8217;t use websocket (ws:\/\/) protocol to connect to my (http:\/\/) server, which used socket.io to handle &hellip; <a href=\"https:\/\/sunapi386.ca\/wordpress\/websocket-socketio-rant\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Websocket Socketio Rant<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-720","post","type-post","status-publish","format-standard","hentry","category-thoughts"],"_links":{"self":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/comments?post=720"}],"version-history":[{"count":1,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/720\/revisions"}],"predecessor-version":[{"id":721,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/posts\/720\/revisions\/721"}],"wp:attachment":[{"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/media?parent=720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/categories?post=720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunapi386.ca\/wordpress\/wp-json\/wp\/v2\/tags?post=720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}