Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased](https://github.com/ganto/pkgproxy/commits/HEAD/)

## [v0.1.2](https://github.com/ganto/pkgproxy/releases/tag/v0.1.2) - 2026-03-28

### Fixed

- Disable Echo v5's default 30-second `WriteTimeout` which killed streaming responses for large package files

## [v0.1.1](https://github.com/ganto/pkgproxy/releases/tag/v0.1.1) - 2026-03-25

### Added
Expand Down
11 changes: 11 additions & 0 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"fmt"
"log/slog"
"net/http"
"os"
"os/signal"
"runtime"
Expand Down Expand Up @@ -126,6 +127,16 @@ func startServer(_ *cobra.Command, _ []string) error {
sc := echo.StartConfig{
Address: fmt.Sprintf("%s:%d", listenAddress, listenPort),
HideBanner: true,
BeforeServeFunc: func(s *http.Server) error {
// Echo v5 defaults WriteTimeout to 30s as Slowloris mitigation
// (GoSec G112). WriteTimeout is a hard wall-clock deadline from
// request header read to response completion, which cuts off
// streaming responses for large package files. If pkgproxy is
// exposed directly, use a reverse proxy (e.g. nginx) with
// appropriate timeouts for Slowloris protection.
s.WriteTimeout = 0
return nil
},
}
return sc.Start(ctx, app)
}
Loading