Don’t use a plugin! You would be obsolete from step one.
To open up to the web you need to use modern standards.
Take a lession from the Leap Motion JS api: WebSockets.
You don’t need to use their code, but at least inspect and learn from it.
Basically the drivers open up a websocket as a transport layer and the JS framework then connects to this.