Serving a local website via bluetooth to a cellphone without using the internet [closed] Serving a local website via bluetooth to a cellphone without using the internet [closed] windows windows

Serving a local website via bluetooth to a cellphone without using the internet [closed]


Yes, by some means such as:

  • Use bluetooth tethering backwards - ie, the phone thinks that the computer is it's source of network connectivity. The computer runs not only the web server, but also a name server (or the phone has a hosts file) so that the name of the website resolves to the IP address of the computer on the bluetooth network. Note that the phone will probably require administrator level access, or existing capability for this.

  • Treat the bluetooth more like a serial connection. Write a service which runs on the phone and accepts network connections from the browser on the phone via the loopback network interface. This then sends the http request over the bluetooth serial link to the PC, where a web-server like program accepts them and responds over the serial-like channel. The service on the phone then provides these back to the browser over the loopback network interface. If you are content with a url such as http://localhost:8080 this would not require administrative access to the device, but merely the ability to run a background service that can listen on network sockets. But to get rid of the :8080 and run on the implicit usual port 80, at least on Android you would need root access.

  • Wrap the phone's browser engine in an application which substitutes serial-like access over the bluetooth in place of network sockets. Alternatively, deploy service idea above this way inside of a custom browser application, so that you don't actually have to run a background package, but only a background service thread within the application that the user is actively using.

  • Buy a home wifi router and don't connect it's WAN port to anything. Get one with enough memory to install a router-linux distro on and you may even be able to host the website on that box and leave the PC out of it. Yes, this isn't a bluetooth solution, just tossing it out there for the simplicity if there's a way it could be acceptable.


Use a Raspberry Pi with Raspbian Linux OS installed. Configure your favorite web server on the Pi (Nginx). Configure the Pi as a WiFi access point running hostapd according to this: https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/install-software

This will give you a really nice, inexpensive, low-power little web server that broadcasts its own WiFi SSID for you to connect all of your devices to.

I have used this to achieve what you are after.


I figured some clear instructions on how to accomplish this on Mac -> iPhone. I'm not sure how (I am asking the "how" in https://superuser.com/questions/1405531/how-does-expressjs-serve-website-over-bluetooth-without-internet)

I have a website served on localhost:9190 with expressjs. On that Mac I went to System Preferences. Within that, go to Sharing. Turn "Internet Sharing" on from and to Bluetooth PAN. Take note of the message at the top about yourmac.local.

Then from System Preferences, go to your Network settings. Bluetooth should pop up with a self-assigned IP. Hit Advanced on that and make sure you set your IPv4 address to Manual. Then according to the example I copy pasted set:

192.168.2.1 subnet 255.255.255.0 and in router address field 192.168.2.1, provide DNS as 8.8.8.8 and second dns 8.8.4.4.

I connected my phone to Mac and from safari went to http://yourmac.local:9190/ and connected fine.