使用自定义流程实现网关协议解析转发功能

This commit is contained in:
2025-02-24 17:21:47 +08:00
parent 10a4f010ce
commit 83f4f06740
25 changed files with 1424 additions and 139 deletions

60
build.ps1 Normal file
View File

@@ -0,0 +1,60 @@
Remove-Job *
$tasks = 0
$start = Get-Date
$tasks++
Write-Output "building proxy server for windows amd64..."
Start-Job -ScriptBlock {
$env:GOOS = "windows"; $env:GOARCH = "amd64"; go build -ldflags '-w -s' -o bin/proxy_server_win_amd64.exe cmd/server/main.go
} | Out-Null
$tasks++
Write-Output "building proxy server for linux amd64..."
Start-Job -ScriptBlock {
$env:GOOS = "linux"; $env:GOARCH = "amd64"; go build -ldflags '-w -s' -o bin/proxy_server_linux_amd64 cmd/server/main.go
} | Out-Null
$tasks++
Write-Output "building proxy server for linux arm64..."
Start-Job -ScriptBlock {
$env:GOOS = "linux"; $env:GOARCH = "arm64"; go build -ldflags '-w -s' -o bin/proxy_server_linux_arm64 cmd/server/main.go
} | Out-Null
$tasks++
Write-Output "building proxy client for windows amd64..."
Start-Job -ScriptBlock {
$env:GOOS = "windows"; $env:GOARCH = "amd64"; go build -ldflags '-w -s' -o bin/proxy_client_win_amd64.exe cmd/client/main.go
} | Out-Null
$tasks++
Write-Output "building proxy client for linux amd64..."
Start-Job -ScriptBlock {
$env:GOOS = "linux"; $env:GOARCH = "amd64"; go build -ldflags '-w -s' -o bin/proxy_client_linux_amd64 cmd/client/main.go
} | Out-Null
$tasks++
Write-Output "building proxy client for linux arm64..."
Start-Job -ScriptBlock {
$env:GOOS = "linux"; $env:GOARCH = "arm64"; go build -ldflags '-w -s' -o bin/proxy_client_linux_arm64 cmd/client/main.go
} | Out-Null
# Wait for all jobs to complete
while ($tasks -gt 0)
{
foreach ($job in Get-Job)
{
if ($job.State -eq "Completed")
{
$tasks--
$job | Receive-Job
$job | Remove-Job
}
}
}
$end = Get-Date
Write-Output "build completed"
Write-Output "time taken: $( ($end - $start).TotalSeconds ) seconds"
Write-Output "output files are in ./bin/"