Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/singpolyma/http-over-btp

HTTP over Browser Transfer Protocol (broken HTTP subset)
https://github.com/singpolyma/http-over-btp

Last synced: about 1 month ago
JSON representation

HTTP over Browser Transfer Protocol (broken HTTP subset)

Awesome Lists containing this project

README

        

This is a piece of Rack middleware and example application.

The middleware assumes that the request body contains a fully-formed HTTP request (optionally only if a certain parameter was passed, just as ?ajax) and parses said request into the Rack environment, overriding anything that came from the actual HTTP request.

The example application takes the environment produced by the middleware, constructs an HTTP request from it, and sends that request on to the server specified by the Host header. A hard-coded or restricted host/port would allow this server to run in production as a proxy onto any HTTP-based API, so that broken HTTP-like clients that only support some HTTP features can proxy onto the real HTTP API.