iServe
Let me explain why you really do need a web server on your iPhone.
When I mentioned this on Twitter and thereabouts, a few days ago, I was greeted with incredulity. After all, the web is big and wide – why would you also need a web server that you can carry around in your pocket?
The answer is simple, and so very obvious that I’m now shocked Apple didn’t think of this themselves.
Let me present my latest invention: iServe.
iServe leverages the ubiquitous technology of the World Wide Web with the fast-becoming-ubiquitous technology of ZeroConf (known as Bonjour in the Apple universe). When you put these two technologies together into a jailbroken iPod Touch or iPhone, you get a portable and fully scalable document viewing platform. Let me explain…
I have been using my iPhone to read PDF files – specifically, I’ve been reading Apple’s Safari Web Content Guide for iPhone OS. It’s useful – and came in handy for iServe – but it’s a book-style PDF file, which means that the pages are too big to be comfortably read on the iPhone’s screen. Silly for Apple to make a mistake like this, but they’re still thinking of a “book” as something that’s printed on 8 1/2 x 11″ or A4 size pages. It isn’t, not really, but PDF format (or rather, the viewers for PDF format) don’t take this into account. So, I read the Apple PDF in landscape mode on my iPhone, but, even with the 480 pixel-width screen, I had to constantly swipe a finger across the screen to see the end of the line I was reading. Not at all pleasant. (Yes, I could shrink the document to fit across the display, but I can not read 4-point font sizes. Reading should not be an optometric exam.)
iServe provides an elegant solution to this problem. Using the lighttpd web server I installed this morning, which has a document root at /var/www, I created a new subdirectory, /var/www/iserve. Into this directory I place whatever PDF, DOC and XLS files I might want to view. I then wrote a Python script, index.py, placed into this directory, so it is executed whenever a request for the iserve directory contents is received. This script simply reads the contents of the directory and gives a nicely-formatted HTML output in response. This script either works directly from Mobile Safari on the iPhone (where it’s accessed at http://localhost/iserve/), or, because of Bonjour services which are always running on the iPhone, it can be accessed at http://lugh.local/iserve/ from any machine residing on the same physical network as my iPhone. And that’s the magic of it: if I want to read a PDF on my iPhone, I can do it, using Mobile Safari as a launchpad. If I want to read it from, say, my MacBook Pro, I can do that too, using Safari (or Firefox) as a launchpad.
Suddenly I have a scaleable, ubiquitous display capability for any of the documents on my iPhone.
A few pictures might help. Here’s the icon for iServe on my iPhone:
When I tap on that icon, I launch Mobile Safari, and this is what I see:
I can scroll through and tap on any of these documents, launching the appropriate viewer.
Now, if I should wander into my flat, I can walk up to my MacBookPro, and do precisely the same thing:
Voila. Portability and scalability. This is more than a convenience. I could perhaps be carrying documents to a client for review. I can review them on the train as I travel to the meeting, then, when I arrive in the client’s offices, I can simply present my iPhone, connect to the client’s network, and browse the documents. The client can do a “Save As…” command on their browser, should they want their own copy of these documents.
It’s all very simple, and very elegant. And it makes me very confused that Apple overlooked this. Now perhaps some enterprising entrepreneur is putting together something in the App Store which does this. In some sense, FileMagnet (an iPhone app which I own) does this. But it’s entirely proprietary and requires a client program to be installed on a Mac or PC. Using standard web technologies makes this much easier. Web browsers are everywhere. Wireless networks are everywhere. Shouldn’t an iPhone or iPod Touch put those ubiquitous resources to work?
Tags: http, iPhone, iServe, lighttpd, ubiquitous computing, web
This entry was posted on Sunday, August 3rd, 2008 at 9:45 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

August 3rd, 2008 at 9:58 pm
You have been busy, haven’t you!
August 3rd, 2008 at 10:43 pm
Oh, that’s just evil, in a good way. I must confess that I’m a twitterer who thought “just what is Mark smoking, here?” but of course, there’s *lots* of reasons to have //localhost. Thank you for the clue.
August 3rd, 2008 at 11:34 pm
This is a great example of the context & perception issue I talked about in a recent Center for the Handheld Web blog article. You have the imagination to perceive that your iPhone can be a server in some contexts, just as it can be a client in other contexts.
I too am unclear why Apple has failed to see that, in the long run, users will take advantage of existing & user-controlled technologies as much as they can. There is a reason many desktops & laptops run a Webserver, there is a reason so many people jailbreak their iPhones, and there is a reason I have server software on my iPhone. The locus of control is with me & you as users, the technology is ubiquitous & easy to use, and the imagination for innovation is mine & yours.
jeffs
August 3rd, 2008 at 11:51 pm
Center for the Handheld Web » Blog Archive » Getting Work Done: Pesce's iServe Example says:[...] Pesce recently posted a new blog entry about why he has a Webserver on his iPhone. He calls it iServe, and it is a great example of an [...]
August 4th, 2008 at 1:32 am
And I’ve just been busy Whoring.