Skip to content

Commit a3294a6

Browse files
Add more error logs and update goproxy dependency (#291)
* Add more error logs and update goproxy dependency * Update workflow actions version * Vendor the required versions
1 parent 9cace3f commit a3294a6

6 files changed

Lines changed: 20 additions & 9 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
go-version: ['1.21', '1.22', '1.23']
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-go@v5
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-go@v6
1919
with:
2020
go-version: ${{ matrix.go-version }}
2121
- name: Setup env
@@ -43,8 +43,8 @@ jobs:
4343
needs: test
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: actions/checkout@v4
47-
- uses: actions/setup-go@v5
46+
- uses: actions/checkout@v6
47+
- uses: actions/setup-go@v6
4848
- name: Install goveralls
4949
run: go install github.com/mattn/goveralls@latest
5050
- name: Close goveralls parallel build

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/rs/xid v1.2.1
1313
github.com/sirupsen/logrus v1.9.0
1414
github.com/stretchr/testify v1.8.0
15-
github.com/stripe/goproxy v0.0.0-20251009123132-ee3e713dae03
15+
github.com/stripe/goproxy v0.0.0-20260615103414-176e55e4af3b
1616
golang.org/x/net v0.17.0
1717
gopkg.in/urfave/cli.v1 v1.20.0
1818
gopkg.in/yaml.v2 v2.4.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ github.com/stripe/goproxy v0.0.0-20250909052350-d1a1594c59ae h1:SNPprcI2Snhux6ba
220220
github.com/stripe/goproxy v0.0.0-20250909052350-d1a1594c59ae/go.mod h1:hF2CVgH4++5ijZiy9grGVP8Fsi4u+SMOtbnIKYbMUjY=
221221
github.com/stripe/goproxy v0.0.0-20251009123132-ee3e713dae03 h1:Wrxanw4xr/0OErvwgq/5LGDHMzWFUkPx2gWwM/fChHM=
222222
github.com/stripe/goproxy v0.0.0-20251009123132-ee3e713dae03/go.mod h1:hF2CVgH4++5ijZiy9grGVP8Fsi4u+SMOtbnIKYbMUjY=
223+
github.com/stripe/goproxy v0.0.0-20260615103414-176e55e4af3b h1:jX6LVUSAoMfMaGJ8LDfdQxIk1DI1FGSwDdgLNZrDSBY=
224+
github.com/stripe/goproxy v0.0.0-20260615103414-176e55e4af3b/go.mod h1:hF2CVgH4++5ijZiy9grGVP8Fsi4u+SMOtbnIKYbMUjY=
223225
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
224226
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
225227
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

pkg/smokescreen/smokescreen.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const (
6767
LogMitmReqMethod = "mitm_req_method"
6868
LogMitmReqHeaders = "mitm_req_headers"
6969
)
70+
7071
type ipType int
7172

7273
type ACLDecision struct {
@@ -623,7 +624,11 @@ func rejectResponse(pctx *goproxy.ProxyCtx, err error) *http.Response {
623624
} else {
624625
status = "Bad gateway"
625626
code = http.StatusBadGateway
626-
msg = "Failed to connect to remote host: " + e.Error()
627+
errMsg := e.Error()
628+
if errMsg == "<nil>" {
629+
errMsg = fmt.Sprintf("<nil> (%T)", err)
630+
}
631+
msg = "Failed to connect to remote host: " + errMsg
627632
}
628633
} else if e, ok := err.(denyError); ok {
629634
status = "Request rejected by proxy"
@@ -655,7 +660,7 @@ func rejectResponse(pctx *goproxy.ProxyCtx, err error) *http.Response {
655660
resp.ProtoMajor = pctx.Req.ProtoMajor
656661
resp.ProtoMinor = pctx.Req.ProtoMinor
657662
resp.Header.Set(errorHeader, msg)
658-
663+
659664
// Add Retry-After header for tunnel limit errors
660665
if _, ok := err.(tunnelLimitError); ok {
661666
resp.Header.Set("Retry-After", "1")

vendor/github.com/stripe/goproxy/https.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ github.com/sirupsen/logrus/hooks/test
6969
## explicit; go 1.13
7070
github.com/stretchr/testify/assert
7171
github.com/stretchr/testify/require
72-
# github.com/stripe/goproxy v0.0.0-20251009123132-ee3e713dae03
72+
# github.com/stripe/goproxy v0.0.0-20260615103414-176e55e4af3b
7373
## explicit; go 1.13
7474
github.com/stripe/goproxy
7575
# golang.org/x/mod v0.8.0

0 commit comments

Comments
 (0)