Git Product home page Git Product logo

connect's Introduction

Cubeast Connect

About

Cubeast Connect is a Bluetooth proxy for Windows, MacOS and Linux. It uses system native Bluetooth API to provide a Websocket API to connect to Bluetooth devices. This allows Cubeast to connect to Bluetooth devices without having to depend on browser's Web Bluetooth API. This solves 2 major issues with Web Bluetooth API:

  • Web Bluetooth API is not supported in all browsers - would allow Cubeast to work in all browsers
  • Web Bluetooth feature set is limited - would allow Cubeast to, among others: connect to cubes automatically when the app starts and easily connect to Gan cubes

API

Currently the app exposes a Websocket API on port 17430. Example of an exchange:

-> {"type":"request", "id":"1", "request":{"method":"version"}}
<- {"type":"response","id":"1","response":{"result":"version","version":1}}
-> {"type":"request", "id":"2", "request":{"method":"start-discovery"}}
<- {"type":"response","id":"2","response":{"result":"ok"}}
<- {"type":"broadcast","broadcast":{"name":"discovered-devices","devices":[{"id":"hci0/dev_E7_25_86_0E_40_5B","name":"GAN-ST05B","address":"E7:25:86:0E:40:5B","signal_strength":null,"manufacturer_data":{}}]}}
-> {"type":"request", "id":"3", "request":{"method":"stop-discovery"}}
<- {"type":"response","id":"3","response":{"result":"ok"}}

connect's People

Contributors

tomekpiotrowski avatar thiccaxe avatar

Stargazers

Henrik Sachse avatar  avatar Sergey Krasnikov avatar  avatar  avatar Jord avatar

Watchers

 avatar  avatar

Forkers

thiccaxe

connect's Issues

Handling Authentication / Authorization

Seeing as giving any old website total access to Bluetooth isn't ideal, some sort of Authentication / Authorization system needs to be implemented.

We should assume that the websocket connection is secure since (1) websites cannot access messages of another website and (2) all network transfer is on 127.0.0.1

There are a few possibilities for these mechanisms:

  1. Done together. I.E., user is asked for Website [X] to have permission to communicate with BT device [y].

  2. Done separately. I.E., user first gives permission for Website [X] to use bluetooth, then Website [X] asks for permission to communicate with BT device [y] later. In this way, Website [X] can communicate with multiple devices over the lifetime of the app, and similarly the user can revoke access to Website [X] entirely.

Considerations

should the website be allowed to see all of the current bluetooth devices? I would say yes, since this is effectively the same as if the website was a native app. Extra permissions and handling regarding this would only unnecessarily increase application complexity.

Linking website to connect app

  • Some sort of token can be issued by the websocket server to the websocket client.
    • this token can contain data within it about the related website/cube or this can be stored in a database on the connect app.
  • Some sort of external verification should be done, I.E. user is asked to copy a 6-digit pin from the connect app to the server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.