Skip to content

Commit

Permalink
feat: create graphical local proxy app (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna authored Jan 17, 2024
1 parent bb5a759 commit 51171d8
Show file tree
Hide file tree
Showing 7 changed files with 1,075 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/examples/fyne-proxy/FyneApp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Details]
Icon = "Icon.png"
Name = "Local Proxy"
ID = "org.getoutline.sdk.examples.fyne_proxy"
Build = 1
Binary file added x/examples/fyne-proxy/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions x/examples/fyne-proxy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Local Proxy with Fyne

This folder has a graphical application that runs a local proxy given a address and configuration.
It uses [Fyne](https://fyne.io/) for the UI.


<img width="231" alt="image" src="https://github.com/Jigsaw-Code/outline-sdk/assets/113565/5d985cb6-3df7-4781-88b0-29f62b22d6d9">
<img width="231" alt="image" src="https://github.com/Jigsaw-Code/outline-sdk/assets/113565/396390ab-4c47-4da9-a544-68645b28e45a">

You can configure your system to use the proxy, as per the instructions below:

- [Windows](https://support.microsoft.com/en-us/windows/use-a-proxy-server-in-windows-03096c53-0554-4ffe-b6ab-8b1deee8dae1)
- [macOS](https://support.apple.com/guide/mac-help/change-proxy-settings-on-mac-mchlp2591/mac)
- [Ubuntu](https://help.ubuntu.com/stable/ubuntu-help/net-proxy.html.en)
- [Other systems and browsers](https://www.avast.com/c-how-to-set-up-a-proxy) (disregard the Avast ads)

## Network Mode
By default the proxy runs on `localhost`, meaning only your host can access it. You can change the address to your local network IP address, and
that will make the proxy available to all devices on the network. Consider the fact that anyone can find and access your server before running
it in local network mode in a public network or a network you don't trust.

## Global Mode
We don't recommend using 0.0.0.0, since that may open up your machine to the outside, and currently there's no encryption or authentication to protect the access.

## Desktop

You can run the app without explicitly cloning the repository with:

```sh
go run github.com/Jigsaw-Code/outline-sdk/x/examples/fyne-proxy@latest
```

To run the local version while developing, from the `fyne-proxy` directory:

```sh
go run .
```

To package, from the app folder:

```sh
go run fyne.io/fyne/v2/cmd/fyne package
```


## Android

To run the app, start the emulator, call fyne install to build and install the app. See https://developer.android.com/studio/run/emulator-commandline

```sh
# Point ANDROID_NDK_HOME to the right location
export ANDROID_NDK_HOME="$HOME/Library/Android/sdk/ndk/26.1.10909125"
# Start the emulator.
$ANDROID_HOME/emulator/emulator -no-boot-anim -avd Pixel_3a_API_33_arm64-v8a
go run fyne.io/fyne/v2/cmd/fyne install -os android
```

If you need, you can build the APK, then install like this:

```sh
go run fyne.io/fyne/v2/cmd/fyne package -os android -appID com.example.myapp
$ANDROID_HOME/platform-tools/adb install ./Local_Proxy.apk
```

## iOS

Install on a running simulator:

```sh
go run fyne.io/fyne/v2/cmd/fyne install -os iossimulator
```

If you package it first, you can install the .app with:

```sh
xcrun simctl install booted ./Local_Proxy.app
```

To install on a real device, you need `ios-deploy` (`brew install ios-deploy`). After you connect your phone, run:

```sh
go run fyne.io/fyne/v2/cmd/fyne install -os ios
```
59 changes: 59 additions & 0 deletions x/examples/fyne-proxy/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module github.com/Jigsaw-Code/outline-sdk/x/examples/fyne-proxy

go 1.20

require (
fyne.io/fyne/v2 v2.4.3
github.com/Jigsaw-Code/outline-sdk/x v0.0.0-20240112224558-7294484cf816
)

require (
fyne.io/systray v1.10.1-0.20231115130155-104f5ef7839e // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Jigsaw-Code/outline-sdk v0.0.11 // indirect
github.com/akavel/rsrc v0.10.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fogleman/gg v1.3.0 // indirect
github.com/fredbi/uri v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe // indirect
github.com/fyne-io/glfw-js v0.0.0-20220120001248-ee7290d23504 // indirect
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 // indirect
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 // indirect
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-text/render v0.0.0-20230619120952-35bccb6164b8 // indirect
github.com/go-text/typesetting v0.0.0-20230616162802-9c17dd34aa4a // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/jackmordaunt/icns/v2 v2.2.6 // indirect
github.com/josephspurrier/goversioninfo v1.4.0 // indirect
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect
github.com/lucor/goinfo v0.9.0 // indirect
github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shadowsocks/go-shadowsocks2 v0.1.5 // indirect
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect
github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/tevino/abool v1.2.0 // indirect
github.com/urfave/cli/v2 v2.11.1 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yuin/goldmark v1.5.5 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect
)
Loading

0 comments on commit 51171d8

Please sign in to comment.