Giter Site home page Giter Site logo

forwardhttp's Introduction

BCH compliance

Retying http forwarder

This HTTP-service will act as a persistent retrying queue. Upon receipt of an HTTP POST, PUT and DELETE-requests, the service will asynchronously forward the received request to a remote host. When the remote host does not return a success, the request will be retried untill success or untill the retry scheme is exhausted. The remote host is indicated by:

  • the HTTP query parameter "HostToForwardTo" or
  • the HTTP-request-header "X-HostToForwardTo"

If required, an synchronous first delivery attempt can be made. This functionality is triggered by:

  • the HTTP query parameter "TryFirst" or
  • the HTTP-request-header "X-TryFirst"

Install

go get github.com/MarcGrol/forwardhttp

cd ${GOPTH}/src/github.com/MarcGrol/forwardhttp

Deploy

Use the gcloud command-line tool

gcloud auth login # expect browser to pop-up for interactive login

gcloud config set project forwardhttp # or your own <gcloud-project>

gcloud app deploy ./main/app.yaml  --quiet --version 1

Service is now available at https://forwardhttp.appspot.com (or your own https://.appspot.com).

Create queue

Use gcloud command-line

gcloud tasks queues create default \
    --max-attempts=10 \
    --max-concurrent-dispatches=5 # prevent overloading remote system

Test

https://forwardhttp.appspot.com

Example to test the interaction:

curl -vvv \
    --request POST \
    --data "This is expected to be sent back as part of response body." \
    "https://forwardhttp.appspot.com/post?HostToForwardTo=postman-echo.com&TryFirst=false"   

forwardhttp's People

Contributors

marcgrol avatar

Stargazers

Laurence de Jong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.