{"id":6113,"date":"2013-03-15T07:05:39","date_gmt":"2013-03-15T07:05:39","guid":{"rendered":"http:\/\/zerokidz.com\/ideas\/?p=6113"},"modified":"2014-06-16T22:43:50","modified_gmt":"2014-06-17T02:43:50","slug":"html5-websockets-and-ruby","status":"publish","type":"post","link":"https:\/\/reactivemusic.net\/?p=6113","title":{"rendered":"html5 websockets and ruby"},"content":{"rendered":"<p>Update 6\/2014 &#8211; Working examples at\u00a0<span style=\"line-height: 1.6;\">Internet sensors projects:\u00a0<\/span><a style=\"line-height: 1.6;\" href=\"https:\/\/reactivemusic.net\/?p=5859\">https:\/\/reactivemusic.net\/?p=5859<\/a><\/p>\n<div class=\"panel\">\n<p>original post<\/p>\n<\/div>\n<h5>notes<\/h5>\n<p><a href=\"http:\/\/www.html5rocks.com\/en\/tutorials\/websockets\/basics\/\">http:\/\/www.html5rocks.com\/en\/tutorials\/websockets\/basics\/<\/a><\/p>\n<p><a href=\"http:\/\/www.websocket.org\/echo.html\">http:\/\/www.websocket.org\/echo.html<\/a><\/p>\n<p><a href=\"http:\/\/html5demos.com\/web-socket\">http:\/\/html5demos.com\/web-socket<\/a><\/p>\n<p>Got some examples running in web sockets (finally). Like with node.js, you can&#8217;t access servers from outside, which specify their ip address as localhost &#8211; you need to actually set a real ip, even if its a private ip like 192.168.1.20<\/p>\n<p>Anyway I was able to get a ruby websocket server running using em-websocket and also another version using eventmachine.<\/p>\n<p>Local files are in tkzic\/websockets<\/p>\n<p>the examples are running a public server at http:\/\/zerokidz.com\/websockets\/index.html<\/p>\n<p>(need to start the server &#8211; also in that directory: .\/server.rb<\/p>\n<p>There&#8217;s also a simple node.js webserver in that folder &#8211; but after solving the problem above &#8211; apache works just fine.<\/p>\n<h5><a href=\"http:\/\/stackoverflow.com\/questions\/14721329\/how-do-i-talk-to-a-client-from-within-a-loop-using-eventmachine\">How do I talk to a client from within a loop using EventMachine?<\/a><\/h5>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update 6\/2014 &#8211; Working examples at\u00a0Internet sensors projects:\u00a0https:\/\/reactivemusic.net\/?p=5859 original post notes http:\/\/www.html5rocks.com\/en\/tutorials\/websockets\/basics\/ http:\/\/www.websocket.org\/echo.html http:\/\/html5demos.com\/web-socket Got some examples running in web sockets (finally). Like with node.js, you can&#8217;t access servers from outside, which specify their ip address as localhost &#8211; you need to actually set a real ip, even if its a private ip like 192.168.1.20 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/reactivemusic.net\/?p=6113\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;html5 websockets and ruby&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[143],"tags":[190,210],"class_list":["post-6113","post","type-post","status-publish","format-standard","hentry","category-interactive-media-art","tag-portfolio","tag-websockets"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>html5 websockets and ruby - reactive music<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/reactivemusic.net\/?p=6113\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"html5 websockets and ruby - reactive music\" \/>\n<meta property=\"og:description\" content=\"Update 6\/2014 &#8211; Working examples at\u00a0Internet sensors projects:\u00a0https:\/\/reactivemusic.net\/?p=5859 original post notes http:\/\/www.html5rocks.com\/en\/tutorials\/websockets\/basics\/ http:\/\/www.websocket.org\/echo.html http:\/\/html5demos.com\/web-socket Got some examples running in web sockets (finally). Like with node.js, you can&#8217;t access servers from outside, which specify their ip address as localhost &#8211; you need to actually set a real ip, even if its a private ip like 192.168.1.20 &hellip; Continue reading &quot;html5 websockets and ruby&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/reactivemusic.net\/?p=6113\" \/>\n<meta property=\"og:site_name\" content=\"reactive music\" \/>\n<meta property=\"article:published_time\" content=\"2013-03-15T07:05:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-06-17T02:43:50+00:00\" \/>\n<meta name=\"author\" content=\"Tom Zicarelli\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom Zicarelli\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6113#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6113\"},\"author\":{\"name\":\"Tom Zicarelli\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"headline\":\"html5 websockets and ruby\",\"datePublished\":\"2013-03-15T07:05:39+00:00\",\"dateModified\":\"2014-06-17T02:43:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6113\"},\"wordCount\":170,\"keywords\":[\"portfolio\",\"websockets\"],\"articleSection\":[\"interactive media art\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6113\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6113\",\"name\":\"html5 websockets and ruby - reactive music\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\"},\"datePublished\":\"2013-03-15T07:05:39+00:00\",\"dateModified\":\"2014-06-17T02:43:50+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6113#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/reactivemusic.net\\\/?p=6113\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6113#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/reactivemusic.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"html5 websockets and ruby\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/\",\"name\":\"reactive music\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/reactivemusic.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\",\"name\":\"Tom Zicarelli\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"caption\":\"Tom Zicarelli\"},\"sameAs\":[\"http:\\\/\\\/tomzicarelli.com\"],\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"html5 websockets and ruby - reactive music","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/reactivemusic.net\/?p=6113","og_locale":"en_US","og_type":"article","og_title":"html5 websockets and ruby - reactive music","og_description":"Update 6\/2014 &#8211; Working examples at\u00a0Internet sensors projects:\u00a0https:\/\/reactivemusic.net\/?p=5859 original post notes http:\/\/www.html5rocks.com\/en\/tutorials\/websockets\/basics\/ http:\/\/www.websocket.org\/echo.html http:\/\/html5demos.com\/web-socket Got some examples running in web sockets (finally). Like with node.js, you can&#8217;t access servers from outside, which specify their ip address as localhost &#8211; you need to actually set a real ip, even if its a private ip like 192.168.1.20 &hellip; Continue reading \"html5 websockets and ruby\"","og_url":"https:\/\/reactivemusic.net\/?p=6113","og_site_name":"reactive music","article_published_time":"2013-03-15T07:05:39+00:00","article_modified_time":"2014-06-17T02:43:50+00:00","author":"Tom Zicarelli","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tom Zicarelli","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/reactivemusic.net\/?p=6113#article","isPartOf":{"@id":"https:\/\/reactivemusic.net\/?p=6113"},"author":{"name":"Tom Zicarelli","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"headline":"html5 websockets and ruby","datePublished":"2013-03-15T07:05:39+00:00","dateModified":"2014-06-17T02:43:50+00:00","mainEntityOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=6113"},"wordCount":170,"keywords":["portfolio","websockets"],"articleSection":["interactive media art"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/reactivemusic.net\/?p=6113","url":"https:\/\/reactivemusic.net\/?p=6113","name":"html5 websockets and ruby - reactive music","isPartOf":{"@id":"https:\/\/reactivemusic.net\/#website"},"datePublished":"2013-03-15T07:05:39+00:00","dateModified":"2014-06-17T02:43:50+00:00","author":{"@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"breadcrumb":{"@id":"https:\/\/reactivemusic.net\/?p=6113#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/reactivemusic.net\/?p=6113"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/reactivemusic.net\/?p=6113#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/reactivemusic.net\/"},{"@type":"ListItem","position":2,"name":"html5 websockets and ruby"}]},{"@type":"WebSite","@id":"https:\/\/reactivemusic.net\/#website","url":"https:\/\/reactivemusic.net\/","name":"reactive music","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/reactivemusic.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571","name":"Tom Zicarelli","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","caption":"Tom Zicarelli"},"sameAs":["http:\/\/tomzicarelli.com"],"url":"https:\/\/reactivemusic.net\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/6113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6113"}],"version-history":[{"count":9,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/6113\/revisions"}],"predecessor-version":[{"id":6124,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/6113\/revisions\/6124"}],"wp:attachment":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}