Compare commits

...

3 Commits

2 changed files with 16 additions and 12 deletions

View File

@ -53,12 +53,10 @@ jobs:
# prepare image tags # prepare image tags
- name: Prepare Image Tags - name: Prepare Image Tags
run: | run: |
echo "DOCKERFILE_FRPC_PATH=dockerfiles/Dockerfile-for-frpc" >> $GITHUB_ENV echo "TAG_FRPC=${{ github.repository_owner }}/frpc" >> $GITHUB_ENV
echo "DOCKERFILE_FRPS_PATH=dockerfiles/Dockerfile-for-frps" >> $GITHUB_ENV echo "TAG_FRPS=${{ github.repository_owner }}/frps" >> $GITHUB_ENV
echo "TAG_FRPC=fatedier/frpc:${{ env.TAG_NAME }}" >> $GITHUB_ENV echo "TAG_FRPC_GPR=ghcr.io/${{ github.repository_owner }}/frpc" >> $GITHUB_ENV
echo "TAG_FRPS=fatedier/frps:${{ env.TAG_NAME }}" >> $GITHUB_ENV echo "TAG_FRPS_GPR=ghcr.io/${{ github.repository_owner }}/frps" >> $GITHUB_ENV
echo "TAG_FRPC_GPR=ghcr.io/fatedier/frpc:${{ env.TAG_NAME }}" >> $GITHUB_ENV
echo "TAG_FRPS_GPR=ghcr.io/fatedier/frps:${{ env.TAG_NAME }}" >> $GITHUB_ENV
- name: Build and push frpc - name: Build and push frpc
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
@ -68,8 +66,10 @@ jobs:
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
push: true push: true
tags: | tags: |
${{ env.TAG_FRPC }} ${{ env.TAG_FRPC }}:${{ env.TAG_NAME }}
${{ env.TAG_FRPC_GPR }} ${{ env.TAG_FRPC }}:latest
${{ env.TAG_FRPC_GPR }}:${{ env.TAG_NAME }}
${{ env.TAG_FRPC_GPR }}:latest
- name: Build and push frps - name: Build and push frps
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
@ -79,5 +79,7 @@ jobs:
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
push: true push: true
tags: | tags: |
${{ env.TAG_FRPS }} ${{ env.TAG_FRPS }}:${{ env.TAG_NAME }}
${{ env.TAG_FRPS_GPR }} ${{ env.TAG_FRPS }}:latest
${{ env.TAG_FRPS_GPR }}:${{ env.TAG_NAME }}
${{ env.TAG_FRPS_GPR }}:latest

View File

@ -29,6 +29,8 @@ import (
libio "github.com/fatedier/golib/io" libio "github.com/fatedier/golib/io"
"github.com/fatedier/golib/pool" "github.com/fatedier/golib/pool"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
httppkg "github.com/fatedier/frp/pkg/util/http" httppkg "github.com/fatedier/frp/pkg/util/http"
"github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/pkg/util/log"
@ -41,7 +43,7 @@ type HTTPReverseProxyOptions struct {
} }
type HTTPReverseProxy struct { type HTTPReverseProxy struct {
proxy *httputil.ReverseProxy proxy http.Handler
vhostRouter *Routers vhostRouter *Routers
responseHeaderTimeout time.Duration responseHeaderTimeout time.Duration
@ -138,7 +140,7 @@ func NewHTTPReverseProxy(option HTTPReverseProxyOptions, vhostRouter *Routers) *
_, _ = rw.Write(getNotFoundPageContent()) _, _ = rw.Write(getNotFoundPageContent())
}, },
} }
rp.proxy = proxy rp.proxy = h2c.NewHandler(proxy, &http2.Server{})
return rp return rp
} }