GithubHelp home page GithubHelp logo

isabella232 / ngsi-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from conwetlab/ngsi-proxy

0.0 0.0 0.0 232 KB

Proxy allowing receiving notifications from Orion Context Broker on browser environments

License: GNU Affero General Public License v3.0

Shell 0.09% JavaScript 94.25% Dockerfile 5.66%

ngsi-proxy's Introduction

ngsi-proxy

Tests Coverage Status

The Orion Context Broker is a great piece of software for managing context information. Using the RESTful API provided from a web browser is easy and can also be simplified by the use of some library (e.g. ngsijs). However, there is a limitation, Orion uses POST request for sending notifications. This notification mechanism makes imposible to directly receive them on a web page. This NGSI proxy creates a server that is capable of receiving POST notifications and redirect them to web pages through an Event Source endpoint.

Usage

You can install the latest stable version of the ngsi-proxy by issuing the followign command:

$ npm install -g ngsi-proxy

Once installed, you will be able to run the ngsi-proxy server by directly using the ngsi-proxy command. By default, it will be listening on port 3000, but you can change it by setting the PORT environment variable:

$ PORT=10000 ngsi-proxy

ngsi-proxy will ignore X-Forwarded-* headers by default. If you need to deploy ngsi-proxy behind a front-end web server, like Apache or Nginx, you can enable those headers by setting the TRUST_PROXY_HEADERS environment variable:

$ TRUST_PROXY_HEADERS=1 ngsi-proxy

You can use a process manager (e.g. pm2) for running ngsi-proxy in a production environment:

$ npm install -g pm2
$ pm2 startup
$ pm2 start ngsi-proxy
$ pm2 save

Take a look into the pm2's documentation for a full list of options.

Running using docker

ngsi-proxy can also be deployed using a docker container. Take a look into the docker image documentation.

Running from source code

If you want to test the latest development version of the ngsi-proxy you will have to download the git repo by issuing the following command:

$ git clone https://github.com/conwetlab/ngsi-proxy.git

Once downloaded, you have to install some dependencies:

$ cd ngsi-proxy
$ npm install

Finally, you will be able to manually run the ngsi-proxy service:

$ node app.js

ngsi-proxy's People

Contributors

aarranz avatar jason-fox 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.