Skip to content

http4s demo that scrapes HTML status pages from SURFboard modem and presents as JSON

Notifications You must be signed in to change notification settings

indyscala/http4s-cable-modem-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

http4s demo for Dec 2016 Indy Scala meetup

This repo is my take on hello world for http4s. It's inspired by surfer, a tool written in Go that exposes Motorola SURFboard stats for Prometheus to scrape.

There are two http4s services... The first service serves static files scraped from a real modem to mock it for demo purposes. The fake modem can be started with:

sbt "run-main Modem"

Visit http://localhost:8080/index.htm to see the fake modem in "action". Pressing "enter" in the SBT terminal after the service is started will close it.

The second service is a proxy that waits for incoming requests, scrapes the fake modem to extract status details, and serves the status to the user as JSON. It can be started with:

sbt "run-main Proxy"

Typically, you will want to start it in a second SBT session in a new terminal window.

The JSON status is exposed at http://localhost:8090/api/status.

About

http4s demo that scrapes HTML status pages from SURFboard modem and presents as JSON

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published