<commit_before>
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.

Middleware
----------

The middleware proxy script runs on a server on the internet.
The client browser connects via socket.io 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 conntent via socket.io to the client browser.
The Client browser then send it back to the ROV and to the requesting application.

proxy-via-browser
---------

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


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<commit_msg>Updating readme<commit_after>
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.

Middleware
----------

The middleware proxy script runs on a server on the internet.
The client browser connects via socket.io 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 conntent via socket.io to the client browser.
The Client browser then send it back to the ROV and to the requesting application.

proxy-via-browser
---------

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


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


How to use
==========

On the middleware server

     node middleware/proxy.js


On the ROV

    cd proxy-via-browser
    node index.js 


{'fraction_non_alphanumeric': 0.09774941215989251, 'fraction_numerical': 0.0026872690628149142, 'mean_word_length': 3.7045813586097944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2907306', 'n_tokens_mistral': 751, 'n_tokens_neox': 697, 'n_words': 460}