mirror of
https://github.com/ThisIsDara/mhr-cfw-go.git
synced 2026-05-18 07:44:46 +03:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 197ee4441f | |||
| 8465e329a0 | |||
| 07ad4415a1 | |||
| 08ba77d13e |
+51
-24
@@ -9,7 +9,28 @@ jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
- os: ubuntu-latest
|
||||
goos: linux
|
||||
goarch: arm64
|
||||
- os: macos-latest
|
||||
goos: darwin
|
||||
goarch: amd64
|
||||
- os: macos-latest
|
||||
goos: darwin
|
||||
goarch: arm64
|
||||
- os: windows-latest
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
- os: windows-latest
|
||||
goos: windows
|
||||
goarch: arm64
|
||||
- os: windows-latest
|
||||
goos: windows
|
||||
goarch: 386
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -21,21 +42,23 @@ jobs:
|
||||
with:
|
||||
go-version: '1.22'
|
||||
|
||||
- name: Build Linux
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: GOOS=linux go build -ldflags "-s -w" -o mhr-cfw-go-linux ./cmd/mhr-cfw
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
export GOOS=${{ matrix.goos }}
|
||||
export GOARCH=${{ matrix.goarch }}
|
||||
go build -ldflags "-s -w" -o mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/mhr-cfw
|
||||
|
||||
- name: Build Windows
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: go build -ldflags "-s -w" -o mhr-cfw-go-windows.exe ./cmd/mhr-cfw
|
||||
- name: Rename Windows executable
|
||||
if: matrix.goos == 'windows'
|
||||
shell: bash
|
||||
run: mv mhr-cfw-go-windows-${{ matrix.goarch }} mhr-cfw-go-windows-${{ matrix.goarch }}.exe
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mhr-cfw-go-${{ matrix.os }}
|
||||
path: |
|
||||
mhr-cfw-go-windows.exe
|
||||
mhr-cfw-go-linux
|
||||
name: mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||
path: mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }}*
|
||||
|
||||
release:
|
||||
needs: build
|
||||
@@ -46,24 +69,28 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download Linux artifact
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: mhr-cfw-go-ubuntu-latest
|
||||
path: .
|
||||
path: ./binaries
|
||||
pattern: mhr-cfw-go-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Download Windows artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: mhr-cfw-go-windows-latest
|
||||
path: .
|
||||
- name: List binaries
|
||||
run: ls -la ./binaries
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
mhr-cfw-go-windows.exe
|
||||
mhr-cfw-go-linux
|
||||
body: "Built from commit ${{ github.sha }}"
|
||||
files: ./binaries/*
|
||||
body: |
|
||||
## Bug Fixes
|
||||
- Fixed Telegram API connectivity issues
|
||||
- Fixed encoding issues on some websites (brotli/zstd decompression)
|
||||
|
||||
## Improvements
|
||||
- Better compatibility with Google Apps Script relay
|
||||
|
||||
🦢
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 dara
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -507,7 +507,13 @@ func (f *DomainFronter) buildPayload(method, urlStr string, headers map[string]s
|
||||
"r": false,
|
||||
}
|
||||
if headers != nil {
|
||||
p["h"] = headers
|
||||
filtered := make(map[string]string)
|
||||
for k, v := range headers {
|
||||
if strings.ToLower(k) != "accept-encoding" {
|
||||
filtered[k] = v
|
||||
}
|
||||
}
|
||||
p["h"] = filtered
|
||||
}
|
||||
if len(body) > 0 {
|
||||
p["b"] = base64.StdEncoding.EncodeToString(body)
|
||||
|
||||
Reference in New Issue
Block a user