WebBluetoothCG / web-bluetooth

Bluetooth support for the Web.
http://www.w3.org/community/web-bluetooth/
Other
1.37k stars 185 forks source link

Is client to client communication (between nearby devices) possible? #586

Closed 7ombie closed 2 years ago

7ombie commented 2 years ago

Is it possible (using WebBluetooth) to implement a webapp that can communicate with another webapp, running on a different (nearby) machine?

For example, could we build a two-player game, with each player running their own client on their own laptop, and have the two clients communicate game state over Bluetooth?

beaufortfrancois commented 2 years ago

It is not possible with the current state of Web Bluetooth. This specification allows websites, running in the Central role only, to connect to remote GATT Servers over a BLE connection. In other words, it does not allow websites to act as bluetooth peripherals which would be required for two-ways communication between web apps using Bluetooth only.

I'd recommend looking at https://www.npmjs.com/package/@abandonware/bleno.

7ombie commented 2 years ago

Thanks, @beaufortfrancois. Much appreciated.

Node is not going to work for me personally. I was considering building something for the Web, but will probably just create a native app to be honest.

Thanks again.