Giter VIP home page Giter VIP logo

outline-go-tun2socks's People

Contributors

alalamav avatar daniellacosse avatar dependabot[bot] avatar dmcardle avatar elenadoty avatar fortuna avatar ignoramous avatar jyyi1 avatar sbruens avatar seanburford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

outline-go-tun2socks's Issues

Error run on windows

I am trying to run the project using go run .\outline\electron\main.go
but I get this error:

github.com/Jigsaw-Code/outline-go-tun2socks/tunnel

tunnel\tunnel.go:36:19: undefined: core.LWIPStack
tunnel\tunnel.go:60:57: undefined: core.LWIPStack

Optimize memory usage with go-shadowsocks2 in bloomring for defense replay attack.

Hi, outline-go-tun2socks is such a brilliant project that really inspired me.

15Mb memory limit on iOS platform is a big challenge, and I think the dependency go-shadowsocks2 bloomring module alloc about 1Mb memory to defense replay attack in client is a little bit luxurious.

Could you please change the bloomring feature to optional?

udp.go:udpHandler.fetchUDPInput timeout too high

At least on two occasions we've noticed very many udp.go:fetchUDPInput go routines block at net.UDPConn.ReadFrom for more than 60 minutes. Not unexpected since the current timeout is set to 2h4m but unsure if such a long idle timeout is req for UDP connections, too. Isn't it the case that most routers close UDP NAT after idling for 30s? If so, 2h4m idle timeout might be way too high. RFC-4787 I stumbled upon, if I read it correctly, recommends at least 2mins or 5mins timeouts for UDP NAT.

One such io-wait:

12-27 20:46:09.819  9777     0 E Go      : goroutine 8785 [IO wait, 72 minutes]:
12-27 20:46:09.819  9777     0 E Go      : internal/poll.runtime_pollWait(0x7f7e0b7158, 0x72, 0x0)
12-27 20:46:09.819  9777     0 E Go      : >/home/murtaza/.gvm/gos/go1.15/src/runtime/netpoll.go:220 +0x3c
12-27 20:46:09.820  9777     0 E Go      : internal/poll.(*pollDesc).wait(0x4000571d18, 0x72, 0x800, 0x800, 0x0)
12-27 20:46:09.820  9777     0 E Go      : >/home/murtaza/.gvm/gos/go1.15/src/internal/poll/fd_poll_runtime.go:87 +0x30
12-27 20:46:09.820  9777     0 E Go      : internal/poll.(*pollDesc).waitRead(...)
12-27 20:46:09.820  9777     0 E Go      : >/home/murtaza/.gvm/gos/go1.15/src/internal/poll/fd_poll_runtime.go:92
12-27 20:46:09.820  9777     0 E Go      : internal/poll.(*FD).ReadFrom(0x4000571d00, 0x40002f0000, 0x800, 0x800, 0x0, 0x0, 0x0, 0x0, 0x0)
12-27 20:46:09.820  9777     0 E Go      : >/home/murtaza/.gvm/gos/go1.15/src/internal/poll/fd_unix.go:215 +0x154
12-27 20:46:09.820  9777     0 E Go      : net.(*netFD).readFrom(0x4000571d00, 0x40002f0000, 0x800, 0x800, 0x7f00180100, 0x7f7d91c260, 0x7f7d981b44, 0x4000189e08, 0x7f0018a000)
12-27 20:46:09.820  9777     0 E Go      : >/home/murtaza/.gvm/gos/go1.15/src/net/fd_posix.go:61 +0x3c
12-27 20:46:09.820  9777     0 E Go      : net.(*UDPConn).readFrom(0x4000310000, 0x40002f0000, 0x800, 0x800, 0x400056e920, 0x40003625a0, 0x0, 0x7f7d93a71c)
12-27 20:46:09.821  9777     0 E Go      : >/home/murtaza/.gvm/gos/go1.15/src/net/udpsock_posix.go:47 +0x3c
12-27 20:46:09.821  9777     0 E Go      : net.(*UDPConn).ReadFrom(0x4000310000, 0x40002f0000, 0x800, 0x800, 0x4000310000, 0x1, 0x0, 0x0, 0x0)
12-27 20:46:09.821  9777     0 E Go      : >/home/murtaza/.gvm/gos/go1.15/src/net/udpsock.go:118 +0x40
12-27 20:46:09.822  9777     0 E Go      : github.com/Jigsaw-Code/outline-go-tun2socks/tunnel/intra.(*udpHandler).fetchUDPInput(0x400007f6c0, 0x7f7daacfa0, 0x4000390ae0, 0x4000022440)
12-27 20:46:09.822  9777     0 E Go      : >/home/murtaza/bravehub/outline-go-tun2socks/tunnel/intra/udp.go:124 +0x2e8
12-27 20:46:09.822  9777     0 E Go      : created by github.com/Jigsaw-Code/outline-go-tun2socks/tunnel/intra.(*udpHandler).Connect
12-27 20:46:09.823  9777     0 E Go      : >/home/murtaza/bravehub/outline-go-tun2socks/tunnel/intra/udp.go:222 +0x344

Thoughts?

Increase MTU size to 16KiB

The MTU for the LWIP stack is currently set at 1500: https://github.com/eycorsican/go-tun2socks/blob/ca0c721c0d65844e43f8b0f090d72d5e9f313515/core/lwip.go#L169

That means each packet from the OS will be at most 1500. Combined with the fact that each read from the go-tun2socks stack only gets us one packet (eycorsican/go-tun2socks#149), that means we do very short writes to the network. This adds overhead to uploads, does more CPU iterations and wastes the larger 16KiB write buffers we allocate.

We should increase the LWIP MTU to 16KiB, since that's the maximum Shadowsocks payload size (https://shadowsocks.org/en/wiki/AEAD-Ciphers.html).

/cc @bemasc @alalamav

Reproducible builds

We currently use GitHub actions to run unit tests on pull requests. We should also automate releases for both Intra and Outline on CI.

Occasional crash in ip.c ip4_route after connectivity change

I see an occasional SIGSEGV/SEGV_MAPERR and SIGBUS/BUS_ADRALN (from using this forked app) emanating presumably from this module when the VPN is restarted (on network change events?). Interestingly, this usually happens after a phone call.

Here's are two such crash logs pointing to ip4_route (see the attached android-bugreport: bugreport-OnePlus6-QKQ1.190716.003-2020-08-10-20-35-23.zip for multiple such tombstones):

08-10 20:12:02.952 20659 20722 F libc    : Fatal signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x14004000000001 in tid 20722 (Thread-24), pid 20659 (elzero.bravedns)
08-10 20:12:03.156 23974 23974 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-10 20:12:03.156 23974 23974 F DEBUG   : Build fingerprint: 'OnePlus/OnePlus6/OnePlus6:10/QKQ1.190716.003/2005052051:user/release-keys'
08-10 20:12:03.156 23974 23974 F DEBUG   : Revision: '0'
08-10 20:12:03.156 23974 23974 F DEBUG   : ABI: 'arm64'
08-10 20:12:03.156 23974 23974 F DEBUG   : Timestamp: 2020-08-10 20:12:03+0530
08-10 20:12:03.156 23974 23974 F DEBUG   : pid: 20659, tid: 20722, name: Thread-24  >>> com.celzero.bravedns <<<
08-10 20:12:03.156 23974 23974 F DEBUG   : uid: 10417
08-10 20:12:03.157 23974 23974 F DEBUG   : signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x14004000000001
08-10 20:12:03.157 23974 23974 F DEBUG   :     x0  0000007d8bd4bb08  x1  0000007dfbc47420  x2  0000007dfbce7b20  x3  0000007d8c26fa2c
08-10 20:12:03.157 23974 23974 F DEBUG   :     x4  0000000000009d82  x5  0000007d8c26fa44  x6  0000000000001194  x7  e414004000000001
08-10 20:12:03.157 23974 23974 F DEBUG   :     x8  000000009d820000  x9  0000000011940000  x10 000000000000007c  x11 0000000000000090
08-10 20:12:03.157 23974 23974 F DEBUG   :     x12 0000000000000001  x13 0000007d906e7c40  x14 0000000000000000  x15 0000007d8bdfd475
08-10 20:12:03.157 23974 23974 F DEBUG   :     x16 0000007e8af068f0  x17 0000007e8aef8070  x18 0000007d77272000  x19 0000007dfbce7b20
08-10 20:12:03.157 23974 23974 F DEBUG   :     x20 0000000000000014  x21 0000007d8c26f630  x22 0000000000000000  x23 0000007d8c26fa08
08-10 20:12:03.157 23974 23974 F DEBUG   :     x24 00000040004ef200  x25 0000007d8c26f630  x26 0000007d8bf01250  x27 0000000000000010
08-10 20:12:03.157 23974 23974 F DEBUG   :     x28 0000004000000d80  x29 0000007d906e7c00
08-10 20:12:03.157 23974 23974 F DEBUG   :     sp  0000007d906e7bc0  lr  0000007d8bd5b0ac  pc  0014004000000001
08-10 20:12:03.157 23974 23974 F DEBUG   :
08-10 20:12:03.157 23974 23974 F DEBUG   : backtrace:
08-10 20:12:03.157 23974 23974 F DEBUG   :       #00 pc 0014004000000001  <unknown>
08-10 20:12:03.157 23974 23974 F DEBUG   :       #01 pc 00000000005d70a8  /data/app/com.celzero.bravedns-uh_UnXi9HudXwQ66hkJ2zA==/base.apk (offset 0x76b000) (ip4_input+476)
08-10 20:35:25.136   583   583 F libc    : crash_dump helper failed to exec
08-11 02:32:32.641  3701  3701 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5d8ecf841fbcad in tid 3701 (elzero.bravedns), pid 3701 (elzero.bravedns)
08-11 02:32:32.888 29947 29947 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-11 02:32:32.889 29947 29947 F DEBUG   : Build fingerprint: 'OnePlus/OnePlus6/OnePlus6:10/QKQ1.190716.003/2005052051:user/release-keys'
08-11 02:32:32.889 29947 29947 F DEBUG   : Revision: '0'
08-11 02:32:32.889 29947 29947 F DEBUG   : ABI: 'arm64'
08-11 02:32:32.891 29947 29947 F DEBUG   : Timestamp: 2020-08-11 02:32:32+0530
08-11 02:32:32.891 29947 29947 F DEBUG   : pid: 3701, tid: 3701, name: elzero.bravedns  >>> com.celzero.bravedns <<<
08-11 02:32:32.891 29947 29947 F DEBUG   : uid: 10417
08-11 02:32:32.891 29947 29947 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5d8ecf841fbcad
08-11 02:32:32.891 29947 29947 F DEBUG   :     x0  105d8ecf841fbc97  x1  0000007dfbdd5800  x2  0000004000050b10  x3  0000004000000480
08-11 02:32:32.891 29947 29947 F DEBUG   :     x4  00000000000004f0  x5  0000004000000690  x6  0000000000000001  x7  0000007dfbdd5800
08-11 02:32:32.891 29947 29947 F DEBUG   :     x8  000000006f0a2304  x9  0000007dfbdc4c00  x10 0000000000000005  x11 0000000000000000
08-11 02:32:32.891 29947 29947 F DEBUG   :     x12 0000007e8dd2c700  x13 0000007fea76cac0  x14 0000007e8dc85550  x15 0000007e8dc85560
08-11 02:32:32.891 29947 29947 F DEBUG   :     x16 0000007e8af06940  x17 0000007e8ae90380  x18 0000007e8e56c000  x19 0000000000000000
08-11 02:32:32.891 29947 29947 F DEBUG   :     x20 105d8ecf841fbc97  x21 000000004a0beaa3  x22 00000000a928e97a  x23 0000000000000001
08-11 02:32:32.891 29947 29947 F DEBUG   :     x24 000000000000bb01  x25 0000007e8de85020  x26 0000007da653e370  x27 0000000000000010
08-11 02:32:32.891 29947 29947 F DEBUG   :     x28 0000004000000480  x29 0000007fea76ca00
08-11 02:32:32.891 29947 29947 F DEBUG   :     sp  0000007fea76c9f0  lr  0000007da6390b78  pc  0000007da638ad74
08-11 02:32:32.898 29947 29947 F DEBUG   :
08-11 02:32:32.898 29947 29947 F DEBUG   : backtrace:
08-11 02:32:32.898 29947 29947 F DEBUG   :       #00 pc 00000000005c9d74  /data/app/com.celzero.bravedns-F-y5acefxdj9t1YfPOXksw==/base.apk (offset 0x1ea000) (pbuf_free+40)

I wasn't sure if this project or go-tun2socks was the right one to report the bug to. That said, we're investigating this as well to see if the app's usage of outline-go-tun2socks is at fault, but haven't found much evidence to suggest that, but we'd continue to look.

Exception: go_seq_go_to_refnum on objective-c objects is not permitted

Hi @alalamav
I got a framework and used it in my iOS project.

The packetTunnel process will crash when it runs self.tunnel.isConnected() and throw Exception: go_seq_go_to_refnum on objective-c objects is not permitted

Did I use the framework wrong somewhere, or it needs some extra lines to fix Constructor and Protocol between go and swift?

import NetworkExtension
import Tun2socks

class PacketTunnelProvider: NEPacketTunnelProvider {
     
    let tunnel = Tun2socksOutlineTunnel()

    override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) {
        guard let conf = (protocolConfiguration as! NETunnelProviderProtocol).providerConfiguration else {
            NSLog("[ERROR] No ProtocolConfiguration Found")
            exit(EXIT_FAILURE)
        }
      
        if (self.tunnel.isConnected()) { // CRASH HERE
          NSLog("isConnected true")
        } else {
          NSLog("isConnected false")
        }

        let networkSettings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: serverIp)
        networkSettings.mtu = 1500

        let ipv4Settings = NEIPv4Settings(addresses: [serverIp], subnetMasks: ["255.255.255.0"])
        ipv4Settings.includedRoutes = [NEIPv4Route.default()]
        networkSettings.ipv4Settings = ipv4Settings

        let DNSSettings = NEDNSSettings(servers: ["223.5.5.5"])
        DNSSettings.matchDomains = [""]
        DNSSettings.matchDomainsNoSearch = false
        networkSettings.dnsSettings = DNSSettings

        setTunnelNetworkSettings(networkSettings) {
            error in guard error == nil else {
                NSLog("Encountered an error setting up the network: \(error.debugDescription)")
                completionHandler(error)
                return
            }

            Tun2socksConnectShadowsocksTunnel(self, "a", 0, "a", "a", true, nil)
            completionHandler(nil)
        }
    }
}

No re-initialization of TCP stack after Close()

I'm pretty sure this is related to Jigsaw-Code/outline-apps#882 and Jigsaw-Code/outline-apps#1476.

When testing the Outline VPN Android client (v1.10.0), I encountered the same logcat output from the linked issues when transitioning from WiFi to LTE while actively connected to an Outline server. I cannot reliably reproduce the issue; it occurs at random.

I did notice that the issue would arise when logcat (on VpnTunnelService) reported that UDP support transitioned from true to false. Looking through tun2socks, I think the issue is the t.lwipStack.Close() call in UpdateUDPSupport(). Close() gets called when UDP support changes, matching the logcat output. Since t.lwipStack is never re-initialized, any call to tunnel.Disconnect() afterwards will call t.lwipStack.Close() on an already closed t.lwipStack, resulting in a double-free. (I tested the double Close() call and got a double free.)

I suppose UpdateUDPSupport should call t.Disconnect() and then re-create a new LWIPStack and tunnel. I haven't had a chance to build the android client to verify the issue and test such a potential fix, so I'm writing up my analysis first to start the discussion.

Error building Tun2Socks on MacOS Sonoma

Tried to build on MacOS Sonoma for apple and got this error:

rm -rf "/Users/user/Files/outline-go-tun2socks/build"
go clean
env GOBIN="/Users/user/Files/outline-go-tun2socks/bin" go install golang.org/x/mobile/cmd/gomobile
env GOBIN="/Users/user/Files/outline-go-tun2socks/bin" /Users/user/Files/outline-go-tun2socks/bin/gomobile init
env PATH="/Users/user/Files/outline-go-tun2socks/bin:/Library/Frameworks/Python.framework/Versions/3.12/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin:/Users/user/flutter/bin" "/Users/user/Files/outline-go-tun2socks/bin/gomobile" bind -iosversion=11.0 -target=ios,iossimulator -o /Users/user/Files/outline-go-tun2socks/build/ios/Tun2socks.xcframework -ldflags '-s -w' -bundleid org.outline.tun2socks github.com/Jigsaw-Code/outline-go-tun2socks/outline/tun2socks github.com/Jigsaw-Code/outline-go-tun2socks/outline/shadowsocks
/Users/user/Files/outline-go-tun2socks/bin/gomobile: xcodebuild -create-xcframework -framework /var/folders/36/m2hq2hc910v6b_q2q82vsrrr0000gn/T/gomobile-work-3566289854/ios/iphoneos/Tun2socks.framework -framework /var/folders/36/m2hq2hc910v6b_q2q82vsrrr0000gn/T/gomobile-work-3566289854/iossimulator/iphonesimulator/Tun2socks.framework -framework /var/folders/36/m2hq2hc910v6b_q2q82vsrrr0000gn/T/gomobile-work-3566289854/iossimulator/iphonesimulator/Tun2socks.framework -output /Users/user/Files/outline-go-tun2socks/build/ios/Tun2socks.xcframework failed: exit status 70
error: cannot compute path of binary 'Path(str: "/private/var/folders/36/m2hq2hc910v6b_q2q82vsrrr0000gn/T/gomobile-work-3566289854/ios/iphoneos/Tun2socks.framework/Versions/A/Tun2socks")' relative to that of '/var/folders/36/m2hq2hc910v6b_q2q82vsrrr0000gn/T/gomobile-work-3566289854/ios/iphoneos/Tun2socks.framework'

make: *** [/Users/user/Files/outline-go-tun2socks/build/ios/Tun2socks.xcframework] Error 1

Documentation - Encryption Methods

I have noticed that there is no documentation regarding which encryption methods are and aren't supported. I also think it would be helpful to point people in the right direction if they want to add an encryption method that isn't supported.

From my testing, I found that these methods to not be supported:

CHACHA20
AES-256-CFB

This is the one I found that was supported:

CHACHA20-IEFT-POLY1305

gomobile, go mod, and go1.16

I tried but couldn't build outline-go-tun2socks with go1.16. It may have to do with the recent changes with go modules in 1.16 but I haven't been able to get to the bottom of it.

The gomobile wiki asks to set go env GO111MODULE=auto, which is set, but the builds still fail:

switch version

  outline-go-tun2socks git:(master) gvm use go1.16
Now using version go1.16.3

build failure:

➜  outline-go-tun2socks git:(master) ./build_android.sh intra
+ readonly BUILD_DIR=build/android
+ BUILD_DIR=build/android
++ mktemp
+ readonly LOG_FILE=/tmp/tmp.DJoid85xXO
+ LOG_FILE=/tmp/tmp.DJoid85xXO
+ readonly TARGET=android-intra
+ TARGET=android-intra
+ rm -rf build/android
+ make clean
rm -rf /home/murtaza/hub/outline-go-tun2socks/build
+ make android-intra
+ tee /tmp/tmp.DJoid85xXO
mkdir -p /home/murtaza/hub/outline-go-tun2socks/build/android
eval ""gomobile bind -a -ldflags '-w'  -target=android -tags android -work -o /home/murtaza/hub/outline-go-tun2socks/build/android/tun2socks.aar" github.com/Jigsaw-Code/outline-go-tun2socks/intra github.com/Jigsaw-Code/outline-go-tun2socks/intra/android github.com/Jigsaw-Code/outline-go-tun2socks/intra/doh github.com/Jigsaw-Code/outline-go-tun2socks/intra/split github.com/Jigsaw-Code/outline-go-tun2socks/intra/protect"
WORK=/tmp/gomobile-work-296560557
gomobile: go build -tags android -ldflags -w -work -buildmode=c-shared -o=/tmp/gomobile-work-296560557/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind failed: exit status 1
WORK=/tmp/gomobile-work-296560557/go-build3347104436
go: github.com/BurntSushi/[email protected]: missing go.sum entry; to add it:
	go mod download github.com/BurntSushi/xgb

make: *** [Makefile:42: android-intra] Error 1
++ cat /tmp/tmp.DJoid85xXO
++ grep WORK=
++ cut -f2 -d=
+ readonly 'GO_WORK_DIR=/tmp/gomobile-work-296560557
/tmp/gomobile-work-296560557/go-build3347104436'
+ GO_WORK_DIR='/tmp/gomobile-work-296560557
/tmp/gomobile-work-296560557/go-build3347104436'
+ '[' '!' -z /tmp/gomobile-work-296560557 /tmp/gomobile-work-296560557/go-build3347104436 ']'
./build_android.sh: line 29: [: /tmp/gomobile-work-296560557: binary operator expected

go env:

➜  outline-go-tun2socks git:(master) go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/u/.cache/go-build"
GOENV="/home/u/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/u/.gvm/pkgsets/go1.16.3/global/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/u/.gvm/pkgsets/go1.16.3/global"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/u/.gvm/gos/go1.16.3"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/u/.gvm/gos/go1.16.3/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/u/hub/outline-go-tun2socks/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3210367305=/tmp/go-build -gno-record-gcc-switches"

Refetching deps go get -d ./... / re-downloading gomobile / re-initing gomobile didn't work.

`make linux` fails on linux

When I run make linux, I see the following:

+ go build '--ldflags= -s -w -X main.version=v1.16.11' -o /build/electron-linux-amd64 ./
Cleaning up build environment...
INFO: Completed!
mv /home/bemasc/outline-go-tun2socks/build/linux/electron-linux-amd64 /home/bemasc/outline-go-tun2socks/build/linux/tun2socks
mv: cannot move '/home/bemasc/outline-go-tun2socks/build/linux/electron-linux-amd64' to '/home/bemasc/outline-go-tun2socks/build/linux/tun2socks': Permission denied
make: *** [Makefile:49: /home/bemasc/outline-go-tun2socks/build/linux/tun2socks] Error 1

ls shows that the binary has been built, but it is owned by root and is not writable by me:

$ ls -l build/linux/electron-linux-amd64 
-rwxr-xr-x 1 root root 3559872 Oct 25 12:37 build/linux/electron-linux-amd64

Presumably this is somehow because of the permissions settings on Docker.

Remove or extend UDP listening timeout

If a read hits the timeout, we stop listening for packets:

proxyConn.SetDeadline(time.Now().Add(h.timeout))
n, addr, err := proxyConn.ReadFrom(buf)
if err != nil {
return
}

I wonder if this is causing issues with apps that use UDP, specially in extreme conditions.

The default timeout is 30 seconds:

udpHandler = oss.NewUDPHandler(t.client, 30*time.Second)

It's not clear to me that we need the timeout. Tun2socks stack will supposedly call udpHandler.Close() when the app socket is closed.

My suggestion is to remove the timeout. At least make is longer, like the 5 minutes we use on the server:
https://github.com/Jigsaw-Code/outline-ss-server/blob/8269318bb6268f9de5b289c31a59da7617520ce8/server.go#L50-L51

gobind is not in the path

I have to add $GOPATH/bin into path manully. I thought this should be added into the makefile since the gomobile is installed with make.

Add Package.swift

Please add "Package.swift" in the release so we can add it to our projects using swift package manager as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.