labnotes

Logging with an HTTP Proxy

Simple MITM debugging

tags
proxy
debugging

I miss having Chrome dev tools when writing node applications, since I often want to see what exactly the network traffic. Here's a way to easily setup a man in the middle proxy to look at all the traffic your application is generating.

Run the docker instance

First we first up the proxy with the web interface:

1
  docker run --rm -it -p 8080:8080 -p 8081:8081 mitmproxy/mitmproxy mitmweb --web-host 0.0.0.0

Node ENV Variables

Then we set the proxy environment variable, and for node specifically, tell it to not worry about self-signed certificates:

1
2
  export HTTP_PROXY=http://localhost:8080
  export NODE_TLS_REJECT_UNAUTHORIZED='0'

Then we run our script:

1
  node outdated.js

Then go visit http://localhost:8081 to see all of the requests that were made.

Simple and easy.

Previously

labnotes

rails uuid primary key

Slightly more obscure

tags
rails
uuid
postgres

Next

howto

Installing faasd

cgi was good, serverless is better

tags
serverless
openfaas