Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkon/api_valve
Lightweight ruby/rack API reverse proxy or gateway.
https://github.com/mkon/api_valve
api-gateway hacktoberfest proxy rack ruby
Last synced: 8 days ago
JSON representation
Lightweight ruby/rack API reverse proxy or gateway.
- Host: GitHub
- URL: https://github.com/mkon/api_valve
- Owner: mkon
- License: mit
- Created: 2018-02-18T21:11:17.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T22:46:05.000Z (8 months ago)
- Last Synced: 2024-03-15T10:11:54.123Z (8 months ago)
- Topics: api-gateway, hacktoberfest, proxy, rack, ruby
- Language: Ruby
- Homepage:
- Size: 168 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ApiValve
[![Gem Version](https://badge.fury.io/rb/api_valve.svg)](https://badge.fury.io/rb/api_valve)
![](https://github.com/mkon/api_valve/workflows/Test/badge.svg?branch=main)
[![Depfu](https://badges.depfu.com/badges/1f5892cc85d02997050e0a4d077c7dc4/overview.svg)](https://depfu.com/github/mkon/api_valve?project_id=5958)Extensible rack application that serves as lightweight API reverse proxy.
## Installation
Just add the gem to your `Gemfile`
```ruby
gem 'api_valve'
```## Usage
See the [examples](https://github.com/mkon/api_valve/tree/master/examples) section on how to
create & configure your own proxy using this gem.### Headers
By default the following headers are forwarded:
* `Accept`
* `Content-Type`
* `User-Agent`
* `X-Real-IP`
* `X-Request-Id`Additionally these headers are generated:
* `X-Forwarded-For`: The ApiGateway is added to the list
* `X-Forwarded-Host`: Filled with original request host
* `X-Forwarded-Port`: Filled with original request port
* `X-Forwarded-Prefix`: Filled with the path prefix of the forwarder within the Api Gateway (eg `SCRIPT_NAME` env)
* `X-Forwarded-Proto`: Filled with original request scheme