Skip to content

Commit 86e5d4f

Browse files
committed
feat(proxy): support HTTP/2 CONNECT
1 parent 85d32bf commit 86e5d4f

10 files changed

Lines changed: 578 additions & 12 deletions

File tree

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM golang:1.26.5-alpine AS builder
3+
FROM golang:1.26.7-alpine AS builder
44
WORKDIR /src
55
COPY go.mod go.sum* ./
66
RUN go mod download

‎README.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ A secure HTTP/HTTPS proxy server in Go with Basic authentication, TLS support, a
1515
## Features
1616

1717
- HTTP and HTTPS proxy modes
18+
- HTTP/2 CONNECT multiplexing in HTTPS mode with HTTP/1.1 fallback
1819
- Basic authentication
1920
- TLS with configurable certificates
2021
- Upstream proxy chaining (proxy chain support)
@@ -25,7 +26,7 @@ A secure HTTP/HTTPS proxy server in Go with Basic authentication, TLS support, a
2526
- Bounded dial, TLS handshake, and response-header timeouts
2627
- Configurable via YAML file
2728
- Systemd service support
28-
- Graceful shutdown of HTTP requests and hijacked CONNECT tunnels
29+
- Graceful shutdown of HTTP requests and HTTP/1.1 or HTTP/2 CONNECT tunnels
2930

3031
## Installation
3132

@@ -121,6 +122,8 @@ The bundled [docker-compose.yml](docker-compose.yml) starts an HTTP proxy, an HT
121122
122123
Certbot checks for renewals every 12 hours. On new TLS handshakes, the HTTPS proxy checks the mounted certificate files at most once per `PROXY_TLS_RELOAD_INTERVAL` (one minute by default). A valid replacement is loaded without restarting the container or interrupting existing connections. If Certbot is temporarily updating the certificate/key pair or the new files are invalid, the proxy keeps the last valid certificate and retries later.
123124
125+
HTTPS mode advertises HTTP/2 and HTTP/1.1 through ALPN. Browsers that support an HTTP/2 secure web proxy multiplex CONNECT tunnels as independent streams on one TLS connection; other clients continue to use the HTTP/1.1 CONNECT path.
126+
124127
### Build from source
125128
126129
1. Clone the repository:
@@ -143,7 +146,7 @@ cmd/https_proxy/ application entry point
143146
internal/config/ configuration loading and validation
144147
internal/auth/ proxy authentication
145148
internal/proxy/ HTTP forwarding, upstream chaining, and server lifecycle
146-
internal/tunnel/ CONNECT tunnel tracking and bidirectional relay
149+
internal/tunnel/ HTTP/1.1 and HTTP/2 CONNECT tracking and bidirectional relay
147150
```
148151
149152
## Configuration

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0
1+
0.5.0

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module github.com/hightemp/https_proxy
22

3-
go 1.26.5
3+
go 1.26.7
44

55
require gopkg.in/yaml.v3 v3.0.1

0 commit comments

Comments
 (0)