leapjs icon indicating copy to clipboard operation
leapjs copied to clipboard

Accessing Tracking Data from Another Computer

Open jochasinga opened this issue 10 years ago • 4 comments

Is there a way that a Node server running leapjs on another computer can connect via websocket to the host computer running leapd on port 6437? i.e. this browser function:

Leap.loop({host: '192.168.x.xx'}, function(frame) {
    // print frame data to browser console
});

Of course on browser this didn't work and got net::ERR_CONNECTION_REFUSED, but is it possible to get the data from another node server? (I noticed in the node.js example there's no way to supply the host argument)

jochasinga avatar Apr 29 '15 07:04 jochasinga

You probably just have your firewall settings blocking that port. On Apr 29, 2015 3:51 AM, "Joe Chasinga" [email protected] wrote:

Is there a way that a Node server running leapjs on another computer can connect via websocket to the host computer running leapd on port 6437? i.e. this browser function:

Leap.loop({host: '192.168.x.xx'}, function(frame) { // print frame data to browser console });

Of course on browser this didn't work and got net::ERR_CONNECTION_REFUSED, but is it possible to get the data from another node server? (I noticed in the node.js example there's no way to supply the host argument)

— Reply to this email directly or view it on GitHub https://github.com/leapmotion/leapjs/issues/203.

capnmidnight avatar Apr 29 '15 09:04 capnmidnight

Yes, this is possible.

Firstly, the code base is almost entirely shared between Node and Web, so passing in the host option should be just the same.

To fix the net::ERR_CONNECTION_REFUSED, check out this thread: https://community.leapmotion.com/t/read-leap-data-from-guest-vm-on-host-machine-using-websockets/1523/9

In a nutshell, non-localhost access is by default forbidden, but this can be configured on a per-machine basis. Also, SSH tunneling is an alternative.

pehrlich avatar Apr 29 '15 19:04 pehrlich

@capnmidnight The webserver is actually configured specifically to accept connections only from localhost. I'm not exactly sure how I would design a sufficiently secure authentication scheme to serve user input content over the general internet.

codemercenary avatar Jul 15 '15 05:07 codemercenary

For others stumbling to this place two years later...

I had to do a few things:

  1. Modify the host IP in base.js (127.0.0.1 by default) to use the IP of the machine the Leap Server is running on.
  2. Modify my config.json file as per this article.
  3. Disable my local Windows firewall.

tkluysk avatar Feb 26 '17 09:02 tkluysk