{"id":36364,"date":"2022-06-27T16:12:06","date_gmt":"2022-06-27T20:12:06","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=36364"},"modified":"2022-06-30T13:45:38","modified_gmt":"2022-06-30T17:45:38","slug":"worldwideweb-app","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/06\/27\/worldwideweb-app\/","title":{"rendered":"WorldWideWeb App"},"content":{"rendered":"<p><a href=\"https:\/\/blog.iconfactory.com\/2022\/06\/worldwideweb-part-2\/\">Craig Hockenberry<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=31613624\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/blog.iconfactory.com\/2022\/06\/worldwideweb-part-2\/\"><p>About a decade ago, things <a href=\"https:\/\/web.archive.org\/web\/20120730020438\/https:\/\/support.apple.com\/kb\/HT5230\">started to change<\/a>. Since then it&rsquo;s gotten <a href=\"https:\/\/twitter.com\/chockenberry\/status\/1511388397855645703\">harder and harder<\/a> to start a simple web server for testing HTML, CSS, and JavaScript. I eventually found <a href=\"https:\/\/gist.github.com\/chockenberry\/9a2b72c7a3d324f9d306e98d5259821d\">a way to do it using AppleScript<\/a>, but as Apple continues to remove open source components from its standard macOS distribution, this workaround isn&rsquo;t likely to last.<\/p><p>So I decided to write my own web server app.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/www.macstories.net\/reviews\/worldwideweb-a-simple-web-server-utility-for-mac-ipad-and-iphone\/\">Alex Guyot<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.macstories.net\/reviews\/worldwideweb-a-simple-web-server-utility-for-mac-ipad-and-iphone\/\"><p>Solidly developer-focused in scope, the app serves files from a local directory to an automatically generated URL, making these files available to any device on your local network.<\/p><p>[&#8230;]<\/p><p>WorldWideWeb enables developers to easily open their in-development website on an actual smartphone- or tablet-sized device rather than using a simulator. They can then make changes to their files and simply reload the browser tab to see those changes live.<\/p><p>[&#8230;]<\/p><p>The story here is quite a bit different for the iPad and iPhone. These devices have previously had no well-known way to achieve the functionality that WorldWideWeb is providing, and certainly not with all the ease and elegance of an app by The Iconfactory. Now, alongside the excellent code editor <a href=\"https:\/\/runestone.app\">Runestone<\/a> (which I <a href=\"https:\/\/www.macstories.net\/reviews\/runestone-a-streamlined-text-and-code-editor-for-iphone-and-ipad\/\">covered here last month<\/a>), WorldWideWeb completes a potential end-to-end pipeline for web development on Apple&rsquo;s mobile platforms.<\/p><\/blockquote>\n\n<p>I wonder how iOS multitasking treats this. I&rsquo;ve certainly had problems using VLC&rsquo;s Web server, because simply tapping a notification or going into Settings puts the app in the background, killing the HTTP connection. I guess that shouldn&rsquo;t be an issue when serving small files, though, and it doesn&rsquo;t support PHP or CGI scripts that might run for a while, though the new version does use WebSockets:<\/p>\n\n<p><a href=\"https:\/\/blog.iconfactory.com\/2022\/06\/worldwideweb-wows\/\">Craig Hockenberry<\/a>:<\/p>\n<blockquote cite=\"https:\/\/blog.iconfactory.com\/2022\/06\/worldwideweb-wows\/\">\n<p>The main improvement in version 1.0.1 is &ldquo;auto refresh&rdquo;. As you edit the text files in your Website Folder, the app watches for changes. When an update is detected, a web socket is used to send a notification to the browser that causes a refresh.<\/p>\n<p>A small bit of JavaScript is injected into every HTML page to make this happen, and the feature can be disabled if that causes a problem.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/04\/21\/apple-discontinues-macos-server\/\">Apple Discontinues macOS Server<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/06\/04\/scripting-languages-to-be-removed\/\">Scripting Languages to Be Removed<\/a><\/li>\n<\/ul>\n\n<p id=\"worldwideweb-app-update-2022-06-30\">Update (2022-06-30): WorldWideWeb <a href=\"https:\/\/mjtsai.com\/blog\/2022\/06\/27\/worldwideweb-app\/#comment-3745837\">plays audio in the background<\/a> in order to keep the network connection alive.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2015\/10\/14\/background-data-and-battery-usage-of-facebooks-ios-app\/\">Background Data and Battery Usage of Facebook&rsquo;s iOS App<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2010\/08\/03\/ios-background-app-kludge\/\">iOS Background App Kludge<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Craig Hockenberry (Hacker News): About a decade ago, things started to change. Since then it&rsquo;s gotten harder and harder to start a simple web server for testing HTML, CSS, and JavaScript. I eventually found a way to do it using AppleScript, but as Apple continues to remove open source components from its standard macOS distribution, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-06-27T20:12:09Z","apple_news_api_id":"cc0731e4-b6cf-4caf-8f1f-43aa2d9e57fe","apple_news_api_modified_at":"2022-06-30T17:45:43Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AzAcx5LbPTK-PH0OqLZ5X_g","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[1468,31,2078,26,772,30,32,2077,1389,218,96,2239],"class_list":["post-36364","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bonjour","tag-ios","tag-ios-15","tag-iosapp","tag-ios-multitasking","tag-mac","tag-macapp","tag-macos-12","tag-vapor","tag-vlc","tag-web","tag-worldwideweb"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=36364"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36364\/revisions"}],"predecessor-version":[{"id":36379,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36364\/revisions\/36379"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=36364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=36364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=36364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}