From 16d61a0bff09d2e62aee97a460c9a1f0d026d2f5 Mon Sep 17 00:00:00 2001 From: Vinicius Fortuna Date: Tue, 10 Oct 2023 17:18:04 -0400 Subject: [PATCH 1/5] Update README.md --- x/examples/outline-fetch/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/examples/outline-fetch/README.md b/x/examples/outline-fetch/README.md index d6467f2f..599cad66 100644 --- a/x/examples/outline-fetch/README.md +++ b/x/examples/outline-fetch/README.md @@ -5,7 +5,7 @@ This app illustrates how to use different transports to fetch a URL in Go. Direct fetch: ```sh -$ go run ./x/examples/outline-fetch/main.go https://ipinfo.io +$ go run github.com/Jigsaw-Code/outline-sdk/x/examples/outline-fetch@latest https://ipinfo.io { ... "city": "Amsterdam", @@ -18,7 +18,7 @@ $ go run ./x/examples/outline-fetch/main.go https://ipinfo.io Using a Shadowsocks server: ```sh -$ go run ./x/examples/outline-fetch/main.go -transport ss://[redacted]@[redacted]:80 https://ipinfo.io +$ go run github.com/Jigsaw-Code/outline-sdk/x/examples/outline-fetch@latest -transport ss://[redacted]@[redacted]:80 https://ipinfo.io { ... "region": "New Jersey", @@ -31,7 +31,7 @@ $ go run ./x/examples/outline-fetch/main.go -transport ss://[redacted]@[redacted Using a SOCKS5 server: ```sh -$ go run ./x/examples/outline-fetch/main.go -transport socks5://[redacted]:5703 https://ipinfo.io +$ go run github.com/Jigsaw-Code/outline-sdk/x/examples/outline-fetch@latest -transport socks5://[redacted]:5703 https://ipinfo.io { ... "city": "Berlin", @@ -44,7 +44,7 @@ $ go run ./x/examples/outline-fetch/main.go -transport socks5://[redacted]:5703 +image From 1402a31915699c8737495189d667d7392187ae0b Mon Sep 17 00:00:00 2001 From: Vinicius Fortuna Date: Tue, 10 Oct 2023 17:20:52 -0400 Subject: [PATCH 3/5] Update README.md --- x/examples/outline-fetch/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/x/examples/outline-fetch/README.md b/x/examples/outline-fetch/README.md index b3835a97..b6a6a53a 100644 --- a/x/examples/outline-fetch/README.md +++ b/x/examples/outline-fetch/README.md @@ -55,5 +55,6 @@ $ go run github.com/Jigsaw-Code/outline-sdk/x/examples/outline-fetch@latest -tra ``` You should see this on Wireshark: + image From 4736780fd1fc75539baf20935b4ce2c2f54c12b3 Mon Sep 17 00:00:00 2001 From: Vinicius Fortuna Date: Tue, 10 Oct 2023 17:21:50 -0400 Subject: [PATCH 4/5] Add optimization flags --- x/mobileproxy/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/mobileproxy/README.md b/x/mobileproxy/README.md index 253cdafa..aad0bc50 100644 --- a/x/mobileproxy/README.md +++ b/x/mobileproxy/README.md @@ -13,8 +13,8 @@ go build -o ./out/ golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobi ### Build the iOS and Android libraries with [`gomobile bind`](https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile#hdr-Build_a_library_for_Android_and_iOS) ```bash -PATH="$(pwd)/out:$PATH" gomobile bind -target=ios -iosversion=11.0 -o "$(pwd)/out/mobileproxy.xcframework" github.com/Jigsaw-Code/outline-sdk/x/mobileproxy -PATH="$(pwd)/out:$PATH" gomobile bind -target=android -androidapi=21 -o "$(pwd)/out/mobileproxy.aar" github.com/Jigsaw-Code/outline-sdk/x/mobileproxy +PATH="$(pwd)/out:$PATH" gomobile bind -ldflags='-s -w' -target=ios -iosversion=11.0 -o "$(pwd)/out/mobileproxy.xcframework" github.com/Jigsaw-Code/outline-sdk/x/mobileproxy +PATH="$(pwd)/out:$PATH" gomobile bind -ldflags='-s -w' -target=android -androidapi=21 -o "$(pwd)/out/mobileproxy.aar" github.com/Jigsaw-Code/outline-sdk/x/mobileproxy ``` Note: Gomobile expects gobind to be in the PATH, that's why we need to prebuild it, and set up the PATH accordingly. From 2e78feeb362ba4414dbc760de36e8f5f055800ec Mon Sep 17 00:00:00 2001 From: Vinicius Fortuna Date: Tue, 10 Oct 2023 17:22:32 -0400 Subject: [PATCH 5/5] Update README.md --- x/mobileproxy/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/mobileproxy/README.md b/x/mobileproxy/README.md index aad0bc50..d4043298 100644 --- a/x/mobileproxy/README.md +++ b/x/mobileproxy/README.md @@ -19,6 +19,8 @@ PATH="$(pwd)/out:$PATH" gomobile bind -ldflags='-s -w' -target=android -androida Note: Gomobile expects gobind to be in the PATH, that's why we need to prebuild it, and set up the PATH accordingly. +The `-ldflags='-s -w'` flag strips debug symbols to reduce the size of the output library. +
Sample iOS generated Code