Skip to content

Commit

Permalink
Update Android example to use kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna authored Oct 12, 2023
1 parent fabe27a commit 95924f0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions x/mobileproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ To add the library to your mobile project, see Go Mobile's [Building and deployi

You need to call the `RunProxy` function passing the local address to use, and the transport configuration.

In Java, you have:
```java
On Android, you can have the following Kotlin code:
```kotlin
// Use port zero to let the system pick an open port for you.
mobileproxy.Proxy proxy = mobileproxy.runProxy("localhost:0", "split:3");
val proxy = mobileproxy.runProxy("localhost:0", "split:3")
// Find the address the local proxy is bound to.
String proxyAddress = proxy.address();
val proxyAddress = proxy.address()
// Configure your networking library with proxyAddress.
...
// Stops the proxy.
proxy.stop();
// ...
// Stop running the proxy.
proxy.stop()
```

## Configure your HTTP client or networking library
Expand Down

0 comments on commit 95924f0

Please sign in to comment.