Skip to content

Commit

Permalink
docs: Update READMEs (#91)
Browse files Browse the repository at this point in the history
- Document optimization flags
- Use absolute URLs in the fetch examples
- Restore split example
  • Loading branch information
fortuna authored Oct 11, 2023
1 parent 89c8f46 commit 421758b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 7 additions & 6 deletions x/examples/outline-fetch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -41,10 +41,10 @@ $ go run ./x/examples/outline-fetch/main.go -transport socks5://[redacted]:5703
}
```

<!-- Using packet splitting:
Using packet splitting:

```sh
$ go run ./x/examples/outline-fetch/main.go -transport split://3 https://ipinfo.io
$ go run github.com/Jigsaw-Code/outline-sdk/x/examples/outline-fetch@latest -transport split:3 https://ipinfo.io
{
...
"city": "Amsterdam",
Expand All @@ -55,5 +55,6 @@ $ go run ./x/examples/outline-fetch/main.go -transport split://3 https://ipinfo
```

You should see this on Wireshark:
<img width="652" alt="image" src="https://github.com/Jigsaw-Code/outline-sdk/assets/113565/9c19667d-d0fb-4d33-b0a6-275674481dce"> -->

<img width="652" alt="image" src="https://github.com/Jigsaw-Code/outline-sdk/assets/113565/9c19667d-d0fb-4d33-b0a6-275674481dce">

6 changes: 4 additions & 2 deletions x/mobileproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ 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.

The `-ldflags='-s -w'` flag strips debug symbols to reduce the size of the output library.

<details>
<summary>Sample iOS generated Code</summary>

Expand Down

0 comments on commit 421758b

Please sign in to comment.