Git Product home page Git Product logo

logger-proxy's Introduction

logger-proxy

proxy_schema

Do you know what a proxy is?ยน

So that's right!

the only difference is that this will write the request information in a .csv file so you know what is being sent by your service that sucks debugging! ๐Ÿ˜™

ยน Do not know what a proxy is? read here: how does http proxy work?

Installation

git clone
yarn install
yarn start

EnvVars

.env variables loaded by default in project root.

Env Variable Description Example
TARGET where the proxy will send the requests must contain protocol, host and port (if not 80) http://localhost:8082
FROM_PORT port that the proxy will be listening 5000
FILE_PATCH path that the log will be stored ./logs
FILE_NAME prefix of the file name, all files are added by [filename + YYMMDDhhmm] log

Example

Imagine that you want to capture all the requests that your backend receives from your frontend layer.

usually you will have your applications structured like this:

FRONT_END

  • PORT=3000
  • API_HOST=http: // localhost: 8082 / api

BACK_END

  • PORT=8082

Whereas you would like to capture requests with the proxy:

FRONT_END

  • PORT=3000
  • API_HOST=http: // localhost: 5000 / api

LOGGER_PROXY

  • TARGET=http: // localhost: 8082
  • FROM_PORT=5000
  • FILE_PATCH=./logs
  • FILE_NAME=log ย 

BACK_END

  • PORT=8082

Watch

  • Dockerfiles are completely useless, since if you create a container, the whole infra will be inside a network, and map the ports every time is very annoying.

  • the proxy only passes requests to http servers, if trying to send through https will not work. pull requests are welcome ๐Ÿ’•

logger-proxy's People

Contributors

andre-torbitoni avatar

Watchers

James Cloos avatar LoN Taku 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.