Developing Against Secure Backends with FeedHenry

What is fh-dev-proxy?

It's a Node Module

Consisting of a tiny API & express middleware to solve a problem...

The Problem

  • We can't access secure web services!
  • Customer whitelists platform for access
  • Developers require access from offices
  • Requesting a VPN is a slow process
  • Developers not 100% in control of access

Problem Overview

Forming a Solution

  • We're impatient, eager, and time is money
  • Platform has access to client services
  • Platform can run Node.js instances
  • We can code...right?

The One Solution?

Do what our apps do!

Use the platform!

Solution Overview

How can we make a reusable solution?

Goals

  • Simple to use
  • Reusable
  • Unobtrusive
  • No need to push code for. Every. Damn. Change
  • One time configuration
  • Should "just work" when deployed to platform
  • Secure!

Intercept calls to core http & https...

*skeptical glares ensue*

Architecture

httpOverride

  • Low level - intercepts calls to http(s).request
  • Works for any modules using http/https
  • Any host that is configured will be proxied
  • Proxied requests sent via https to platform (secure)
  • Special headers to transmit original request
  • Platform sends request using original protocol
  • Streams response to local development machine

Using fh-dev-proxy

It's easy.

Steps

  1. Create a service using this template
  2. Add PROXY_VALID_HOSTS env var to service
  3. In cloud app run npm i fh-dev-proxy@0.2.1 --save
  4. Wrap cloud app code like this
  5. Profit?

Questions & Demo

fh-dev-proxy

By Evan Shortiss

fh-dev-proxy

A guide to local development against secure backend services.

  • 1,118