Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: The network of built iOS framework did not follow iOS system proxy setting #47162

Open
mstzou opened this issue Jul 13, 2021 · 1 comment

Comments

@mstzou
Copy link

@mstzou mstzou commented Jul 13, 2021

What version of Go are you using (go version)?

$ go version
go version go1.16.4 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/miller/Library/Caches/go-build"
GOENV="/Users/miller/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/miller/go/pkg/mod"
GOOS="darwin"
GOPATH="/Users/miller/go"
GOPROXY="direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.4"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/miller/work/mobile_lib-up/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/yl/g7gxm3p11wx1jmf9db2jtlh80000gn/T/go-build3020972396=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

We use gomobile bind command to build iOS framework library, the library is just using net/http to do a simple http request to google or some website.

When we using Xcode to include the iOS framework we built and then build the iOS app, everything is working fine as usual.

But if we set system proxy in iOS setting or using other apps (e.g. Charles or other vpn/proxy apps) to set system proxy,
we found the IOS framework library is not following the system proxy setting, it goes the original network setting without proxy.
Which leads the issue that network cannot work correctly. For some case that the network only allowed internal proxy, for example in some company corporate network.

gomobile build command:

gomobile bind -ldflags -X 'gitlab.xxx/mobile_lib/libs.version=v0.2.29' -X 'gitlab.xxxx/mobile_lib/pkg/logger.osType=ios' -X 'gitlab.xxxx/mobile_lib/pkg/logger.version=v0.2.29'  -target=ios -v -o out/ios/anv gitlab.xxxx/mobile_lib/libs

gomobile version:

golang.org/x/mobile v0.0.0-20200329125638-4c31acba0007

What did you expect to see?

The network of built iOS framework should respect system proxy setting

What did you see instead?

@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Jul 13, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants