From c150ffb220c15f10076b86fb2776a782a4d098ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 24 Jan 2023 10:03:59 +0100 Subject: Gun 2.0 --- _build/content/articles/gun-2.0.0.asciidoc | 80 +++++ _build/data/projects/gun.toml | 4 +- articles/asciideck/index.html | 4 + articles/cowboy-2.0.0-pre.4/index.html | 4 + articles/cowboy-2.0.0-rc.1/index.html | 4 + articles/cowboy-2.0.0-rc.2/index.html | 4 + articles/cowboy-2.0.0/index.html | 4 + articles/cowboy-2.1.0/index.html | 4 + articles/cowboy-2.2.0/index.html | 4 + articles/cowboy-2.3.0/index.html | 4 + articles/cowboy-2.4.0/index.html | 4 + articles/cowboy-2.5.0/index.html | 4 + articles/cowboy-2.6.0/index.html | 4 + articles/cowboy-2.7.0/index.html | 4 + articles/cowboy-2.8.0/index.html | 4 + articles/cowboy-2.9.0/index.html | 4 + articles/cowboy2-qs/index.html | 4 + articles/dont-let-it-crash/index.html | 4 + .../erlang-meetup-10-septembre-2019/index.html | 4 + articles/erlang-scalability/index.html | 4 + articles/erlang-validate-utf8/index.html | 4 + articles/erlang.mk-and-relx/index.html | 4 + .../index.html | 4 + articles/erlanger-playbook/index.html | 4 + articles/farwest-funded/index.html | 4 + articles/github-sponsors/index.html | 4 + articles/gun-1.0.0-rc.1/index.html | 4 + articles/gun-1.0.0/index.html | 4 + articles/gun-1.2.0/index.html | 4 + articles/gun-1.3.0/index.html | 4 + articles/gun-2.0.0-pre.1/index.html | 4 + articles/gun-2.0.0-pre.2/index.html | 4 + articles/gun-2.0.0-rc.1/index.html | 4 + articles/gun-2.0.0/index.html | 355 +++++++++++++++++++++ articles/index.html | 38 ++- articles/index.xml | 13 +- articles/january-2014-status/index.html | 4 + articles/joe_the_rubber_duck/index.html | 4 + articles/merry-christmas-2018/index.html | 4 + articles/merry-christmas-2019/index.html | 4 + articles/ml-archives/index.html | 4 + articles/on-open-source/index.html | 4 + articles/page/2/index.html | 38 +-- articles/page/3/index.html | 18 ++ articles/ranch-1.3/index.html | 4 + articles/ranch-1.6.0/index.html | 4 + articles/ranch-1.7.0/index.html | 4 + articles/ranch-2.0.0-rc.1/index.html | 4 + articles/ranch-2.0.0/index.html | 4 + articles/ranch-2.1.0/index.html | 4 + articles/ranch-ftp/index.html | 4 + articles/the-elephant-in-the-room/index.html | 4 + articles/the-gateway-trilogy/index.html | 4 + articles/the-story-so-far/index.html | 4 + articles/tictactoe/index.html | 4 + articles/website-update/index.html | 4 + articles/xerl-0.1-empty-modules/index.html | 4 + articles/xerl-0.2-two-modules/index.html | 4 + articles/xerl-0.3-atomic-expressions/index.html | 4 + articles/xerl-0.4-expression-separator/index.html | 4 + articles/xerl-0.5-intermediate-module/index.html | 4 + docs/en/gun/2.0/guide/introduction.asciidoc | 2 +- docs/en/gun/2.0/guide/introduction/index.html | 2 +- docs/en/gun/2.0/guide/migrating_from_1.3.asciidoc | 43 ++- .../en/gun/2.0/guide/migrating_from_1.3/index.html | 22 +- docs/index.xml | 2 +- donate/index.html | 2 + erlanger-playbook/index.html | 2 + index.html | 4 +- index.xml | 13 +- services/index.html | 2 + sitemap.xml | 7 +- 72 files changed, 814 insertions(+), 49 deletions(-) create mode 100644 _build/content/articles/gun-2.0.0.asciidoc create mode 100644 articles/gun-2.0.0/index.html diff --git a/_build/content/articles/gun-2.0.0.asciidoc b/_build/content/articles/gun-2.0.0.asciidoc new file mode 100644 index 00000000..79720bd9 --- /dev/null +++ b/_build/content/articles/gun-2.0.0.asciidoc @@ -0,0 +1,80 @@ ++++ +date = "2023-01-24T07:00:00+01:00" +title = "Gun 2.0" + ++++ + +Gun `2.0.0` has been released! + +Gun 2.0 adds a ton of features along with a small number +of breaking changes. + +Gun 2.0 includes state of the art tunnel support. With +Gun 2.0 it is possible to make requests or data go through +any number of proxy endpoints using any combination of +TCP or TLS transports and HTTP/1.1, HTTP/2 or SOCKS5 +protocols. All combinations of the scenario Proxy1 -> +Proxy2 -> Origin are tested and known to work. + +You can watch a demo of the tunnel support below. This +video is the first of its kind. If you like it, or you +don't like it, please tell me! I intend to continue +producing those on a semi-regular basis. Watch: + +++++ + +++++ + +Gun 2.0 can now be used to send and receive raw data, +as if it was just a normal socket. This can be +useful when needing to connect through a number +of HTTP/SOCKS5 proxies, allowing the use of Gun's +great proxying capabilities for non-Web protocols. +This can also be useful when performing HTTP/1.1 +Upgrade to custom protocols. + +Gun 2.0 adds many more features such as Websocket over +HTTP/2, Websocket protocol negotiation, a built-in +cookie store, graceful shutdown, flow control for +data messages, event handlers and more. + +Gun 2.0 greatly improves the HTTP/2 performance when it +comes to receiving large response bodies; and when receiving +response bodies from many separate requests concurrently. + +Gun 2.0 will be more responsive in the event of connection +failures. It now checks return values from send calls and +has send timeouts enabled by default. For HTTP/2 a new +option allows Gun to drop the connection when pings do +not get a response in a timely manner. + +Gun now shares much of its HTTP/2 code with Cowboy, +including the HTTP/2 state machine. Numerous issues were +fixed as a result because the Cowboy implementation was +much more advanced. + +The Gun connection process is now implemented using `gen_statem`. + +The `gun_pool` module is a significant experimental feature +that allows users to create pools of connections. Pools +are split by authority and a user-provided token, allowing +users to reuse connections in a similar way to what Web +browsers are doing. Please check it out and provide feedback! + +Gun 2.0 requires Erlang/OTP 22.0 or greater and is tested +and supported on Linux, macOS and Windows. + +A complete +list of changes can be found in the migration guide: +https://ninenines.eu/docs/en/gun/2.0/guide/migrating_from_1.3/[Migrating from Gun 1.3 to 2.0]. + +I will now focus on implementing HTTP/3 and QUIC, first +in Cowboy and then in Gun. + +You can donate to this project via +https://github.com/sponsors/essen[GitHub Sponsors]. + +As usual, feedback is appreciated, and issues or +questions should be sent via Github tickets. Thanks! diff --git a/_build/data/projects/gun.toml b/_build/data/projects/gun.toml index 79280d82..a777d713 100644 --- a/_build/data/projects/gun.toml +++ b/_build/data/projects/gun.toml @@ -1,10 +1,10 @@ title = "Gun" catchphrase = "The smoking gun of HTTP clients." -description = "Asynchronous, always-connected client with support for HTTP/1.1, HTTP/2 and Websocket." +description = "Asynchronous client with support for HTTP/1.1, HTTP/2, Websocket and more." name = "gun" repository = "https://github.com/ninenines/gun" versions = ["2.0", "1.3", "1.2", "1.1", "1.0"] -branches = ["master", "1.3.1", "1.2.0", "1.1.0", "1.0.0"] +branches = ["2.0.0", "1.3.1", "1.2.0", "1.1.0", "1.0.0"] has_source = true has_guide = true has_manual = true diff --git a/articles/asciideck/index.html b/articles/asciideck/index.html index 60a1708f..1ad52960 100644 --- a/articles/asciideck/index.html +++ b/articles/asciideck/index.html @@ -109,6 +109,10 @@ http://www.gnu.org/software/src-highlite --> +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.0.0-pre.4/index.html b/articles/cowboy-2.0.0-pre.4/index.html index a95b0f95..79741b77 100644 --- a/articles/cowboy-2.0.0-pre.4/index.html +++ b/articles/cowboy-2.0.0-pre.4/index.html @@ -128,6 +128,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.0.0-rc.1/index.html b/articles/cowboy-2.0.0-rc.1/index.html index 6aae6533..3920e1ea 100644 --- a/articles/cowboy-2.0.0-rc.1/index.html +++ b/articles/cowboy-2.0.0-rc.1/index.html @@ -99,6 +99,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.0.0-rc.2/index.html b/articles/cowboy-2.0.0-rc.2/index.html index e3e017cb..280688cf 100644 --- a/articles/cowboy-2.0.0-rc.2/index.html +++ b/articles/cowboy-2.0.0-rc.2/index.html @@ -92,6 +92,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.0.0/index.html b/articles/cowboy-2.0.0/index.html index a7aaa2db..c47ec919 100644 --- a/articles/cowboy-2.0.0/index.html +++ b/articles/cowboy-2.0.0/index.html @@ -98,6 +98,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.1.0/index.html b/articles/cowboy-2.1.0/index.html index bf8164da..ae0af495 100644 --- a/articles/cowboy-2.1.0/index.html +++ b/articles/cowboy-2.1.0/index.html @@ -95,6 +95,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.2.0/index.html b/articles/cowboy-2.2.0/index.html index da01e9f5..021c4781 100644 --- a/articles/cowboy-2.2.0/index.html +++ b/articles/cowboy-2.2.0/index.html @@ -93,6 +93,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.3.0/index.html b/articles/cowboy-2.3.0/index.html index 5cdf603f..64a0c76d 100644 --- a/articles/cowboy-2.3.0/index.html +++ b/articles/cowboy-2.3.0/index.html @@ -85,6 +85,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.4.0/index.html b/articles/cowboy-2.4.0/index.html index 21494ef5..3d0027a8 100644 --- a/articles/cowboy-2.4.0/index.html +++ b/articles/cowboy-2.4.0/index.html @@ -87,6 +87,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.5.0/index.html b/articles/cowboy-2.5.0/index.html index f251fef9..707d1d6d 100644 --- a/articles/cowboy-2.5.0/index.html +++ b/articles/cowboy-2.5.0/index.html @@ -91,6 +91,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.6.0/index.html b/articles/cowboy-2.6.0/index.html index 84e340f7..a9131a16 100644 --- a/articles/cowboy-2.6.0/index.html +++ b/articles/cowboy-2.6.0/index.html @@ -88,6 +88,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.7.0/index.html b/articles/cowboy-2.7.0/index.html index d6398dce..8f5b7c05 100644 --- a/articles/cowboy-2.7.0/index.html +++ b/articles/cowboy-2.7.0/index.html @@ -89,6 +89,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.8.0/index.html b/articles/cowboy-2.8.0/index.html index bee4f587..81752a81 100644 --- a/articles/cowboy-2.8.0/index.html +++ b/articles/cowboy-2.8.0/index.html @@ -88,6 +88,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy-2.9.0/index.html b/articles/cowboy-2.9.0/index.html index d355b58d..cf7e4521 100644 --- a/articles/cowboy-2.9.0/index.html +++ b/articles/cowboy-2.9.0/index.html @@ -87,6 +87,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/cowboy2-qs/index.html b/articles/cowboy2-qs/index.html index 234fe0d5..2e9af5e5 100644 --- a/articles/cowboy2-qs/index.html +++ b/articles/cowboy2-qs/index.html @@ -129,6 +129,10 @@ http://www.gnu.org/software/src-highlite --> +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/dont-let-it-crash/index.html b/articles/dont-let-it-crash/index.html index 2ff5ce37..46377706 100644 --- a/articles/dont-let-it-crash/index.html +++ b/articles/dont-let-it-crash/index.html @@ -104,6 +104,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/erlang-meetup-10-septembre-2019/index.html b/articles/erlang-meetup-10-septembre-2019/index.html index 74bfa4b3..c0d939d5 100644 --- a/articles/erlang-meetup-10-septembre-2019/index.html +++ b/articles/erlang-meetup-10-septembre-2019/index.html @@ -84,6 +84,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/erlang-scalability/index.html b/articles/erlang-scalability/index.html index 80bfb622..2570eca2 100644 --- a/articles/erlang-scalability/index.html +++ b/articles/erlang-scalability/index.html @@ -116,6 +116,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/erlang-validate-utf8/index.html b/articles/erlang-validate-utf8/index.html index c36466fe..58909037 100644 --- a/articles/erlang-validate-utf8/index.html +++ b/articles/erlang-validate-utf8/index.html @@ -232,6 +232,10 @@ http://www.gnu.org/software/src-highlite --> +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/erlang.mk-and-relx/index.html b/articles/erlang.mk-and-relx/index.html index 1f1ffa2e..3a61fe7b 100644 --- a/articles/erlang.mk-and-relx/index.html +++ b/articles/erlang.mk-and-relx/index.html @@ -118,6 +118,10 @@ cowboy-0.8.5 erlydtl-0.7.0 ninenines-0.2.0 stdlib-1.19.1 +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/erlanger-playbook-september-2015-update/index.html b/articles/erlanger-playbook-september-2015-update/index.html index 26d53bb9..47432860 100644 --- a/articles/erlanger-playbook-september-2015-update/index.html +++ b/articles/erlanger-playbook-september-2015-update/index.html @@ -87,6 +87,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/erlanger-playbook/index.html b/articles/erlanger-playbook/index.html index 51f49fc9..6ab64aeb 100644 --- a/articles/erlanger-playbook/index.html +++ b/articles/erlanger-playbook/index.html @@ -128,6 +128,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/farwest-funded/index.html b/articles/farwest-funded/index.html index 8e61b935..d95a3b5e 100644 --- a/articles/farwest-funded/index.html +++ b/articles/farwest-funded/index.html @@ -88,6 +88,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/github-sponsors/index.html b/articles/github-sponsors/index.html index 697d4a47..3ed48066 100644 --- a/articles/github-sponsors/index.html +++ b/articles/github-sponsors/index.html @@ -85,6 +85,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/gun-1.0.0-rc.1/index.html b/articles/gun-1.0.0-rc.1/index.html index 44a60f9c..283f1463 100644 --- a/articles/gun-1.0.0-rc.1/index.html +++ b/articles/gun-1.0.0-rc.1/index.html @@ -89,6 +89,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/gun-1.0.0/index.html b/articles/gun-1.0.0/index.html index 6b3ea5f1..35b35ec0 100644 --- a/articles/gun-1.0.0/index.html +++ b/articles/gun-1.0.0/index.html @@ -88,6 +88,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/gun-1.2.0/index.html b/articles/gun-1.2.0/index.html index 20eb9597..906c2143 100644 --- a/articles/gun-1.2.0/index.html +++ b/articles/gun-1.2.0/index.html @@ -88,6 +88,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/gun-1.3.0/index.html b/articles/gun-1.3.0/index.html index bff135f3..5a7342a2 100644 --- a/articles/gun-1.3.0/index.html +++ b/articles/gun-1.3.0/index.html @@ -86,6 +86,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/gun-2.0.0-pre.1/index.html b/articles/gun-2.0.0-pre.1/index.html index af0f8a54..97925295 100644 --- a/articles/gun-2.0.0-pre.1/index.html +++ b/articles/gun-2.0.0-pre.1/index.html @@ -93,6 +93,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/gun-2.0.0-pre.2/index.html b/articles/gun-2.0.0-pre.2/index.html index b82636fd..afe588ed 100644 --- a/articles/gun-2.0.0-pre.2/index.html +++ b/articles/gun-2.0.0-pre.2/index.html @@ -91,6 +91,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/gun-2.0.0-rc.1/index.html b/articles/gun-2.0.0-rc.1/index.html index 9f9b12f2..a34c37b3 100644 --- a/articles/gun-2.0.0-rc.1/index.html +++ b/articles/gun-2.0.0-rc.1/index.html @@ -96,6 +96,10 @@ +
  • Gun 2.0
  • + + +
  • Ranch 2.1
  • diff --git a/articles/gun-2.0.0/index.html b/articles/gun-2.0.0/index.html new file mode 100644 index 00000000..87a52979 --- /dev/null +++ b/articles/gun-2.0.0/index.html @@ -0,0 +1,355 @@ + + + + + + + + + + Nine Nines: Gun 2.0 + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    +

    Gun 2.0

    +

    + 2023 + 24 Jan +

    +
    + +

    Gun 2.0.0 has been released!

    +

    Gun 2.0 adds a ton of features along with a small number of breaking changes.

    +

    Gun 2.0 includes state of the art tunnel support. With Gun 2.0 it is possible to make requests or data go through any number of proxy endpoints using any combination of TCP or TLS transports and HTTP/1.1, HTTP/2 or SOCKS5 protocols. All combinations of the scenario Proxy1 -> Proxy2 -> Origin are tested and known to work.

    +

    You can watch a demo of the tunnel support below. This video is the first of its kind. If you like it, or you don't like it, please tell me! I intend to continue producing those on a semi-regular basis. Watch:

    +

    Gun 2.0 can now be used to send and receive raw data, as if it was just a normal socket. This can be useful when needing to connect through a number of HTTP/SOCKS5 proxies, allowing the use of Gun's great proxying capabilities for non-Web protocols. This can also be useful when performing HTTP/1.1 Upgrade to custom protocols.

    +

    Gun 2.0 adds many more features such as Websocket over HTTP/2, Websocket protocol negotiation, a built-in cookie store, graceful shutdown, flow control for data messages, event handlers and more.

    +

    Gun 2.0 greatly improves the HTTP/2 performance when it comes to receiving large response bodies; and when receiving response bodies from many separate requests concurrently.

    +

    Gun 2.0 will be more responsive in the event of connection failures. It now checks return values from send calls and has send timeouts enabled by default. For HTTP/2 a new option allows Gun to drop the connection when pings do not get a response in a timely manner.

    +

    Gun now shares much of its HTTP/2 code with Cowboy, including the HTTP/2 state machine. Numerous issues were fixed as a result because the Cowboy implementation was much more advanced.

    +

    The Gun connection process is now implemented using gen_statem.

    +

    The gun_pool module is a significant experimental feature that allows users to create pools of connections. Pools are split by authority and a user-provided token, allowing users to reuse connections in a similar way to what Web browsers are doing. Please check it out and provide feedback!

    +

    Gun 2.0 requires Erlang/OTP 22.0 or greater and is tested and supported on Linux, macOS and Windows.

    +

    A complete list of changes can be found in the migration guide: Migrating from Gun 1.3 to 2.0.

    +

    I will now focus on implementing HTTP/3 and QUIC, first in Cowboy and then in Gun.

    +

    You can donate to this project via GitHub Sponsors.

    +

    As usual, feedback is appreciated, and issues or questions should be sent via Github tickets. Thanks!

    + + +
    +
    + +
    +

    More articles

    + + +

    Feedback

    +

    Feel free to email us +if you found any mistake or need clarification on any of the +articles.

    + +
    +
    +
    +
    + + + + + + + + diff --git a/articles/index.html b/articles/index.html index 7fc81f6f..8911e938 100644 --- a/articles/index.html +++ b/articles/index.html @@ -63,6 +63,24 @@

    Articles

    +
    +
    +

    Gun 2.0

    +

    + 2023 + 24 Jan +

    +
    + +

    Gun 2.0.0 has been released! +Gun 2.0 adds a ton of features along with a small number of breaking changes. +Gun 2.0 includes state of the art tunnel support. With Gun 2.0 it is possible to make requests or data go through any number of proxy endpoints using any combination of TCP or TLS transports and HTTP/1.1, HTTP/2 or SOCKS5 protocols. All combinations of the scenario Proxy1 -> Proxy2 -> Origin are tested and known to work.

    + +

    + Read More +

    +
    +

    Ranch 2.1

    @@ -411,26 +429,6 @@ You can donate to this project via GitHub Sponsors. These funds are used to pay

    -
    -
    -

    Gun 1.2

    -

    - 2018 - 17 Sep -

    -
    - -

    Gun 1.2.0 has been released! -Gun is an HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP. -Gun now supports issuing CONNECT requests to HTTP proxies in order to establish tunnels to origin servers. Gun can establish tunnels over one or more proxies as necessary. -All existing protocols can be used inside the tunnel, including HTTP/1.1, HTTP/2 and Websocket over both TCP and TLS connections. -Note that it is currently not possible to tunnel a TLS connection via an HTTPS proxy due to limitations in the current version of Erlang/OTP.

    - -

    - Read More -

    -
    -