
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
bluetooth-websocket-api
Advanced tools
Bluetooth Websocket API - a JavaScript library that provides a simple WebSocket API to find, connect and interact with Bluetooth devices.
The Bluetooth WebSocket API is an abstraction layer on top of the Web Bluetooth JavaScript API. The Web Bluetooth API allows websites to connect and interact with Bluetooth Low Energy devices. The library does not introduces a new API but extends the JavaScript functions as WebSocket messages. This can be handy when you want to write Bluetooth enabled webapps and already have an implementation on the server.
As the Bluetooth operations are dictated by the server, the front-end setup is straight forward. The Bluetooth search command, connect and communication are all initiated by the server side.
There are many different protocols on top of the WebSocket standard. The library has been designed while having this in mind, hence there is a separation between the library core and WebSocket adapter. Today Phoenix framework WebSocket channels are supported.
This library consists of three parts:
Core
Handles the Web Bluetooth API and maps functions to the WebSocket adapter.
Adapter
WebSocket specific implementation, formats and sends the messages back/forth between Core and the server.
App
An example app of usage is included in the repo, this can be used together with the Phoenix server reference app Bluetooth WebSocket Server.
Below is a simplified chart showing the different Bluetooth messages passed through the library.
For more detail of each socket event please see the Wiki page Wiki - Socket messages specification.
Install node_module with npm install
openssl genrsa -out localhost.key 2048
openssl req -new -x509 -key localhost.key -out localhost.cert -days 3650 -subj /CN=localhost
/keys/
node server.js
Now you can visit localhost:3000
with SSL from your browser.
app/app/js
npm run build
dist/app.js
node server.js
Now you can visit localhost:3000/app
from your browser.
Of course you can use your apache server.
base64
when you read/write value.Adapter#requestDevice()
method should be fired by click event (due to WebBluetoothAPI specification).characteristicvaluechanged
event is fired by after not only its value changes but also a value change notification/indication (due to WebBluetoothAPI specification).FAQs
Bluetooth Websocket API - a JavaScript library that provides a simple WebSocket API to find, connect and interact with Bluetooth devices.
The npm package bluetooth-websocket-api receives a total of 5 weekly downloads. As such, bluetooth-websocket-api popularity was classified as not popular.
We found that bluetooth-websocket-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.