├── android/ # Flutter + Go 安卓端 │ ├── lib/ # Flutter Dart 代码 │ ├── go/ # Go Mobile 绑定代码 │ ├── android/ # Android 原生配置 │ └── pubspec.yaml ├── server/ # Go 服务器端 │ ├── main.go │ └── go.mod
基于 Flutter + Go Mobile 的网页浏览器应用。
www.google.com 域名请求www.baidu.com,原始域名保存在 shost 请求头192.168.68.124:8080go install golang.org/x/mobile/cmd/gomobile@latest gomobile init
cd android/go
gomobile bind -target=android -o ../android/app/libs/proxy.aar ./proxy
cd android
flutter pub get
flutter build apk --release
android/build/app/outputs/flutter-apk/app-release.apkGo 编写的反向代理服务器。
shost 请求头恢复原始域名# Linux amd64
cd server
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o proxy-server-linux-amd64 .
# Windows amd64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o proxy-server-windows-amd64.exe .
# 默认监听 8080 端口
./proxy-server-linux-amd64
# 如需 HTTPS,修改 main.go 中的 certFile 和 keyFile
www.google.comwww.baidu.comshost: www.google.com192.168.68.124:8080shost 头读取原始域名