Kenny2github / scratch-dexter

A Scratch extension to interact with Dexter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation for setup of node.js proxy

JamesNewton opened this issue · comments

I've documented the setup for this at:
https://github.com/HaddingtonDynamics/Dexter/wiki/Scratch-extension

Please feel free to copy that documentation to this repo to help people make use of it.

It's too bad that scratch can't directly communicate to the websocket proxy script that is already on the current robot. Perhaps we can add the proxy function to the DDE software.

I've invited you as a collaborator so you can do this yourself (I can't view the source code for the Dexter repo wiki).

As for directly communicating, it would be possible if Dexter supported WebSockets instead of raw sockets. Browser JavaScript is allowed to use WebSockets, so if Dexter used them too then the browser could connect directly to Dexter.

Dexter can run Node.JS and there is already a websocket to socket proxy script available. In the future, we plan on that starting automatically when Dexter boots, or being able to launch it from the firmware via an oplet. See this page:
https://github.com/HaddingtonDynamics/Dexter/wiki/nodejs-webserver#a-node-js-websocket-server
but when I tried to use it, chrome complained about the cross site scripting. There may be some way to resolve that, but I don't know what it is.

It looks like you already have placed the necessary documentation into the repo readme.md file. That looks good to me so I will close this issue. If we want to explore using Dexters internal Node.JS server, we can do that on another issue.