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

docs: Update READMEs #91

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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