Skip to content

Fastly Logging Proxy to remove need for Challenge/Response on end server, for example to use with testing with services like RequestBin and Zapier.

Notifications You must be signed in to change notification settings

grokify/fastly-logging-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fastly Log Streaming HTTPS Proxy

This proxy enables using Fastly's HTTPS log streaming with Compute@Edge support to services that cannot implement Fastly's challenge/response protocolo, like RequestBin, Zapier and others.

This small server supports the Fastly HTTPS logging challenge at /.well-known/fastly/logging/challenge and proxes to the server URL at the environment variable PROXY_URL without a challenge-response.

Note: It is configured to be deployed to Heroku's free tier for testing purposes. This can be adjusted by forking this repo and editing the app.json file.

See more here:

To Do

  • Proxy server-side logging from HTTPS log streaming
  • Heroku one button deployment (default to free tier)
  • Papertrail logging on Heroku (defaulls to free tier). Currently covers proxy service only
  • Proxy Fastly server-side logging directly to Papertrail
  • Fastly CLI Tail Logging support by implementing subscription service

Installation

Heroku

Deploy

During the installation process, set the following environment variables.

Variable Type Required Notes
PORT integer n auto-populated by Heroku
FASTLY_SERVICE_IDS string n a comma-delimited list of Service IDs. To support any Service ID, leave empty or explicitly set to *. Do not run the SHA256 checksum yourself, as the proxy service will automaticaly hash the Service IDs in the FASTLY_SERVICE_IDS environment variable.
PROXY_URL string y the URL where the incoming body should be posted to. Only HTTP POST method is supported for now.

Once this is set up, set your Heroku URL to be your Fastly logging endpoint, for example:

https://{my-log-proxy}.herokuapp.com

The challenge response will be automatically provided at:

https://{my-log-proxy}.herokuapp.com/.well-known/fastly/logging/challenge

Running locally

If you want to run this service locally, you can do this by running it behind a ngrok reverse proxy.

Other

For other deployment modes, this is a simple zero-dependency net/http server and should be easy to deploy.

About

Fastly Logging Proxy to remove need for Challenge/Response on end server, for example to use with testing with services like RequestBin and Zapier.

Topics

Resources

Stars

Watchers

Forks