Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a way to run a little web server on our phones? It's a device that's always on, and usually on Wi-Fi


Most modern phone OSes today try to limit background services to squeeze battery life out of idle states. Even though "always on", some of the idle states are extreme battery misers. For instance, even the iPhone 14 with its "always on display" is doing some really interesting idle stuff, the "always on display" itself refreshes as 1 frame per second or slower (sometimes one frame per minute! as the clock is the only guaranteed to update, once a minute). It seems like the device is always responsive due to how "instant" it wakes from idle states.

All of which are a lot of very interesting reasons why you can't just run a web server on your current phone with its current modern OS and expect it to have 24/7 up time even though it feels to you like your phone has 24/7 responsiveness uptime.

It's a solvable problem if there were enough interest: light web hosting is something that could be added to the list of system services that can wake the device from idle states (in similar ways to how notification services get prioritized, or trickle data feeds like Find My Services). It's not likely a problem that current phone OSes are incentivized to support, though, because there's currently no reason for millions of people to want websites served from their pockets.

Maybe one day there will be an interesting P2P data "hosting" protocol that would be useful for modern OSes to prioritize in that way.


You can but it would drain the battery fast. You can use an old phone that stays plugged in, but my old abandoned phones were all abandoned for a reason, usually because some critical part of them doesn't work anymore.

Search for "fanless mini pc" on Amazon or whatever and you'll be surprised. There's a lot of cool devices available that are approximately the size of a phone, use very low power (under 15 W) like a phone, are under $200 brand-new, have wired ethernet built in, USB ports, HDMI ports, can run normal Linux, and unlike Raspberry Pi they are actually in stock.


See https://news.ycombinator.com/item?id=31841051Repurposing an old Android phone as a web server


I have an old phone set up here, running Octo4a. It's working great.

https://github.com/feelfreelinux/octo4a


The folks at IconFactory recently published a web server for iOS. https://apps.apple.com/us/app/worldwideweb-mobile/id16230068...


Oh nice! And it's from IconFactory :D


I once ran some GNU/Linux distro on Android, and then Tomcat on it :)


termux (android) can run python, node, docker and more, but you should have static IP or some tunneling like cloudflare/tailscale/zerotier




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: