Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9f0b7e7
Vendor mint and hpax
ericmj Apr 11, 2026
1d49bda
Add hex_core HTTP adapter backed by vendored Mint
claude Apr 12, 2026
f8b595b
Unify HTTP/1 and HTTP/2 pool, fix 1xx handling
ericmj Apr 12, 2026
498942b
Stream request bodies, fix IPv4/IPv6 fallback, document Mint PRs
ericmj Apr 12, 2026
d9b22b8
Add real HTTPS integration tests against hex.pm and repo.hex.pm
ericmj Apr 12, 2026
1d91327
Cover proxy routing, IPv4/IPv6 pool separation, Conn crash recovery
ericmj Apr 12, 2026
746cd7c
Default to HTTP/1 only — faster than HTTP/2 for hex's workload
ericmj Apr 12, 2026
7ed01c0
Patch Mint to tune HTTP/2 connection-level window
ericmj Apr 12, 2026
6c6550e
Negotiate HTTP/2 by default
ericmj Apr 12, 2026
e35c023
Re-vendor Mint with set_window_size/3, call it from Conn
ericmj Apr 12, 2026
305b204
Re-vendor Mint with larger default HTTP/2 receive windows
ericmj Apr 13, 2026
cce6345
Stream response bodies to disk in request_to_file/6
ericmj Apr 13, 2026
6cb3a6c
Re-vendor Mint v1.11.0 and hpax v1.1.0
ericmj Oct 5, 2026
f1acc1a
Honor Expect: 100-continue and HTTP/2 flow control for request bodies
ericmj Oct 5, 2026
6de2843
Strip pins from binary sizes in vendored Mint
ericmj Oct 5, 2026
5a3147a
Open pool connections on demand
ericmj Oct 6, 2026
b3d7b10
Remove unused clauses from Hex.HTTP
ericmj Oct 6, 2026
5f9c598
Vendor Mint with license notices and without docs or pin warnings
ericmj Oct 6, 2026
37a267f
Offer the cipher suites HTTP/2 allows first
ericmj Oct 6, 2026
d9a7ef5
Restore httpc's proxy, credential and retry behavior in Hex.HTTP
ericmj Oct 6, 2026
030d67a
Fix connection lifecycle bugs in the HTTP pool
ericmj Oct 6, 2026
d35b976
Retry a GET that times out
ericmj Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[
inputs: [
"*.exs",
"config/*.exs",
"lib/**/*.ex",
"test/**/*.{ex,exs}"
]
inputs:
["*.exs", "config/*.exs", "test/**/*.{ex,exs}"] ++
(Path.wildcard("lib/**/*.ex") -- Path.wildcard("lib/hex/mint/**/*.ex"))
]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ Exclude integration tests with `mix test --exclude integration`.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

### Vendored code

`lib/hex/mint/` and `src/hex_mint_shims.erl` contain copies of [Mint](https://github.com/elixir-mint/mint) (Copyright 2018 Eric Meadows-Jönsson and Andrea Leopardi) and [HPAX](https://github.com/elixir-mint/hpax) (Copyright 2021 Eric Meadows-Jönsson and Andrea Leopardi), modified by `scripts/vendor_mint.sh`. They're licensed under the Apache License, Version 2.0.
16 changes: 2 additions & 14 deletions lib/hex/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ defmodule Hex.Application do
Mix.SCM.append(Hex.SCM)
Mix.RemoteConverger.register(Hex.RemoteConverger)

start_httpc()

opts = [strategy: :one_for_one, name: Hex.Supervisor]
Supervisor.start_link(children(), opts)
end
Expand All @@ -33,23 +31,12 @@ defmodule Hex.Application do
defp dev_setup, do: :ok
end

defp start_httpc() do
:inets.start(:httpc, profile: :hex)

opts = [
max_sessions: 8,
max_keep_alive_length: 4,
keep_alive_timeout: 120_000
]

:httpc.set_options(opts, :hex)
end

if Mix.env() == :test do
defp children do
[
Hex.Netrc.Cache,
Hex.State,
Hex.HTTP.Pool,
Hex.Server,
{Hex.Parallel, [:hex_registry_fetcher, &registry_concurrency/0]},
{Hex.Parallel, [:hex_tarball_fetcher, &tarball_concurrency/0]}
Expand All @@ -60,6 +47,7 @@ defmodule Hex.Application do
[
Hex.Netrc.Cache,
Hex.State,
Hex.HTTP.Pool,
Hex.Server,
{Hex.Parallel, [:hex_registry_fetcher, &registry_concurrency/0]},
{Hex.Parallel, [:hex_tarball_fetcher, &tarball_concurrency/0]},
Expand Down
Loading
Loading