GithubHelp home page GithubHelp logo

dmccubbing / openrov-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openrov/openrov-proxy

0.0 2.0 0.0 2.07 MB

License: GNU Affero General Public License v3.0

Shell 61.75% JavaScript 30.48% HTML 7.77%

openrov-proxy's Introduction

Proxy and middleware to retrieve things via the client browser

As the OpenROV does not have access to the internet itself, we need some option to retrieve files from the web.

THe idea is that the client browser downloads any files needed. That can't be done easily as cross site scripting rules prohibit access to other URLS.

A way to get around this, is to have a server on the internet, for example on a AWS server that acts as a middleware.

For reporting issues: Use the primary software repository: https://github.com/OpenROV/openrov-software/issues

Middleware

The middleware proxy script runs on a server on the internet. The client browser connects via BinaryJS (https://github.com/binaryjs/binaryjs/) to it. Any request that comes through a proxy from the ROV are sent to the middleware on the server. The server downloads the files and sends the contents via BinaryJS streams to the client browser. The Client browser then send it back to the ROV and to the requesting application via BinaryJS.

proxy-via-browser

A http server that publishes a simple html file that does all the BinaryJS connections and passes the messages. Beside that, it acts as a proxy server to accept connections from commands on the ROV (like npm).

How to use

On the middleware server

 node middleware/proxy.js

On the ROV

cd proxy-via-browser
node index.js 

Using npm with a proxy

We have to tell npm to use a proxy and to use HTTP to connect to the registry:

   npm config set registry http://registry.npmjs.org/
   npm config set proxy http://localhost:3000

Testing with wget or curl

To test the connection the best is to use wget or curl

wget:

http_proxy=localhost:3000 wget http://www.google.com/images/srpr/logo11w.png

curl:

curl --proxy localhost:3000 http://www.google.com/images/srpr/logo11w.png

openrov-proxy's People

Contributors

codewithpassion avatar brianadams avatar

Watchers

James Cloos avatar  avatar

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.