Code Monkey home page Code Monkey logo

http2demo's Introduction

Example HTTP/2+TLS App

This app is a simple Spring Boot app implementing HTTP/2 and TLS via the standard Spring Boot embedded Tomcat server.

This apparently causes a problematic interaction with the AWS ALB under certain conditions.

Building

This is a standard Spring Boot app. You can produce a Docker image from it using the command ./gradlew bootBuildImage --imageName http2demo:latest (or whatever name is appropriate for the registry where you intend to upload the image). This has also already been done within this github project via an Action and the result is available publicly as ghcr.io/p120ph37/http2demo:latest

Deploying

You'll have to figure out how to deploy this in your particular AWS environment. Anywhere that is behind an ALB should work. The ALB should be set to present an HTTP/2 listener, and to use the HTTP/2+TLS for the target-group as well. The app itself could be run on ECS or an EC2 instance, as long as it is fronted by an ALB. The app listens on port 8443 and speaks HTTPS+HTTP/2.

Reproducing

The issue occurs when a large multipart POST request is made to this application through an ALB (but not when the same request is made directly). These commands can be used to produce the problematic behavior:

# Check that the ALB is working... (Will reply with the strinf "Ok")
curl -v -k --http2 https://my-alb-name-1234567890.us-east-1.elb.amazonaws.com/

# Produce a test data file full of some random bytes...
dd if=/dev/random of=./100MB.dat bs=1048576 count=100

# Try to upload the data through the ALB to the app...
# (will fail with a 503-Bad-Gateway error)
curl -v -k --http2 https://my-alb-name-1234567890.us-east-1.elb.amazonaws.com/upload -F [email protected]

# Try the same upload to the instance private IP directly...
# (will succeed)
curl -v -k --http2 https://10.1.2.3:8443/upload -F [email protected]

http2demo's People

Contributors

p120ph37 avatar

Watchers

 avatar

Forkers

livevoxeng

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.