Skip to content

Commit 319d920

Browse files
committed
feat: Add DirectPortForward-Go - a high-performance TCP port forwarder
- Implement main functionality for TCP port forwarding with configurable options. - Introduce JSON-based configuration for local and remote addresses, connection limits, timeouts, and logging levels. - Add built-in metrics for monitoring active connections, total connections, and data transfer statistics. - Implement graceful shutdown handling and resource management to prevent leaks. - Create README.md with detailed usage instructions, configuration examples, and performance tips.
0 parents  commit 319d920

5 files changed

Lines changed: 1413 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*" # Triggers on version tags like v1.0.0, v2.1.3, etc.
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Create Release
14+
runs-on: ubuntu-latest
15+
outputs:
16+
upload_url: ${{ steps.create_release.outputs.upload_url }}
17+
version: ${{ steps.get_version.outputs.version }}
18+
steps:
19+
- name: Get version from tag
20+
id: get_version
21+
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
22+
23+
- name: Create Release
24+
id: create_release
25+
uses: actions/create-release@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
tag_name: ${{ github.ref }}
30+
release_name: Release ${{ steps.get_version.outputs.version }}
31+
draft: false
32+
prerelease: false
33+
34+
build:
35+
name: Build Binaries
36+
needs: release
37+
runs-on: ubuntu-latest
38+
strategy:
39+
matrix:
40+
include:
41+
- goos: linux
42+
goarch: amd64
43+
output: portforward-linux-amd64
44+
- goos: linux
45+
goarch: arm64
46+
output: portforward-linux-arm64
47+
- goos: windows
48+
goarch: amd64
49+
output: portforward-windows-amd64.exe
50+
- goos: darwin
51+
goarch: amd64
52+
output: portforward-darwin-amd64
53+
- goos: darwin
54+
goarch: arm64
55+
output: portforward-darwin-arm64
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v3
59+
60+
- name: Set up Go
61+
uses: actions/setup-go@v4
62+
with:
63+
go-version: "1.21"
64+
65+
- name: Build binary
66+
env:
67+
GOOS: ${{ matrix.goos }}
68+
GOARCH: ${{ matrix.goarch }}
69+
run: |
70+
go build -ldflags="-s -w" -o ${{ matrix.output }} main.go
71+
72+
- name: Upload Release Asset
73+
uses: actions/upload-release-asset@v1
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
with:
77+
upload_url: ${{ needs.release.outputs.upload_url }}
78+
asset_path: ./${{ matrix.output }}
79+
asset_name: ${{ matrix.output }}
80+
asset_content_type: application/octet-stream

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Code coverage profiles and other test artifacts
15+
*.out
16+
coverage.*
17+
*.coverprofile
18+
profile.cov
19+
20+
# Dependency directories (remove the comment below to include it)
21+
# vendor/
22+
23+
# Go workspace file
24+
go.work
25+
go.work.sum
26+
27+
# env file
28+
.env
29+
30+
# Editor/IDE
31+
# .idea/
32+
# .vscode/
33+
34+
config.json

0 commit comments

Comments
 (0)