kazu-yamamoto / http2

HTTP/2.0 library including HPACK
BSD 3-Clause "New" or "Revised" License
86 stars 23 forks source link

Releasing v5.0.0 #100

Closed kazu-yamamoto closed 7 months ago

kazu-yamamoto commented 1 year ago

I'm going to release a new major version. I should choose v5.0.0 instead of v4.3.0 because warp sets a loose upper boundary . Breaking changes include:

A client takes an Aux argument:

type Client a = (forall b. Request -> (Response -> IO b) -> IO b) -> Aux -> IO a

Aux is:

data Aux = Aux
    { auxPossibleClientStreams :: IO Int
    -- ^ How many streams can be created without blocking.
    , auxServerMaxStreams :: IO Int
    -- ^ Getting server's SETTINGS_MAX_CONCURRENT_STREAMS.
    --   If the server does not inform it,
    --   'concurrentStreams' is used.
    }

You can set concurrentStreams and windowSize through ClientConfig in client's run. For forward compatibility, ClientConfig constructor is not exported.

Server's run now takes ServerConfig which you can specify the parameters above and numberOfWorkers.

V5.0.0 controls flow very well, so servers can prevent DoS from clients. If you are interested, use grep -r "FLOW CONTROL" Network to find code for DoS prevention.

@epoberezkin @akshaymankar @edsko If you have time, please give a look at master. Any comments are welcome.