Hacker News new | ask | show | jobs
by roxil 1041 days ago
I see at least one very good reason why this shoud be possible: old phones. Reusing old phones as a webserver seems like a good idea to me, since they were built for power efficiency (unlike old PCs) and would otherwise simply end up as e-waste in a landfill or discarded, forgotten in a drawer somewhere.

Maybe it's because I use LineageOS (and Cyanogen mod before that), but I never even knew that there were problems with being able to run a web server on android. Just recently, while I was bored on a train ride, I used the Fdroid app Lightweight Web Server (LWS) to send some files to a friend on iPhone for which I would otherwise have no easier way of doing (whatsapp upload is slower and filesize is limited). I move the files into the folder, prepare the HTML file a bit, then my friend sets up a wifi hotspot, I connect and tell my friend to enter the IP-Address or scan a QR code. Works nicely for me (although weirdly it doesn't work if I create the hotspot. I need to connect to theirs, I wonder why)

Even if this is something I only use rarely, using a phone that can't do something this simple is unacceptable to me. It's satisfying in itself that I don't want my phone manufacturer to arbitrarily limit what the hardware can and cannot do. Would I suggest running a business website off my phone? No. I doubt it's secure, performance is limited, ddos would be a possible issue. Do I still want to be able to do silly things with the devices I purchase? Absolutely.

Another point, if I remember correctly, a cellphone mesh network of some kind was useful for Hong Kong protestors at one point at least.

4 comments

>[phones] were built for power efficiency

most of that power efficiency is based on deep sleep modes and network packet batching. Opposite of what servers do

I don't think the guy is suggesting phones are great general purpose servers people should host online services on.

On their own, they are small and efficient. Proper servers need 10x, 100x, or more power just to boot. Sure, AMD has some amazingly efficient Zen 4 cores now. But cores don't exist in a vacuum. Just spinning the fans on such a machine consumes more power than a phone could even dissipate.

Not saying about what and where anyone should run, all I'm claiming is that mobile phones aren't actually that efficient, they just sleep a lot and that's how they get low power draw
Any Android phone already doesn’t usually get security updates after a year or two and you want to run a web server on it?
> Would I suggest running a business website off my phone? No. I doubt it's secure, performance is limited, ddos would be a possible issue. Do I still want to be able to do silly things with the devices I purchase? Absolutely.

Running a web server on a mostly-trusted LAN for 5 minutes doesn't sound like the security risk you're trying to paint it as

For simple p2p file sharing, you can try using [toffeeshare.com](https://toffeeshare.com/)
When you start up the hotspot, what address is your friend using to connect?
Your friend creates the hotspot, you connect to it like any other WiFi network and then for the address, they enter the IP of your phone which is shown on the lws app or it can be scanned as a qr code. (It doesn't work for some reason, if you create the hotspot. I don't know why. I edited my previous post to correct this detail)
Not OP but I would try something with a .1 ending, deriving the first three bytes from the client phone's IP. Although, when creating a hotspot, Android might make a new network namespace for it so you still wouldn't be able to connect to the web server.