GithubHelp home page GithubHelp logo

xxf098 / go-tun2socks-build Goto Github PK

View Code? Open in Web Editor NEW
186.0 186.0 81.0 401 KB

tun2socks with v2ray & xray support for Android

License: GNU General Public License v3.0

Makefile 0.52% Go 99.48%
android golang tun2socks v2ray xray

go-tun2socks-build's People

Contributors

xxf098 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

go-tun2socks-build's Issues

release for iOS ??

Who can help play an iOS framework?

I keep trying to pack it wrong...

go get 失败

mac os
go version go1.17.6 darwin/arm64
执行
$: go get -d ./...
go: github.com/v2fly/v2ray-core/[email protected] (replaced by ../v2ray-core): reading ../v2ray-core/go.mod: open /Users/develop/Documents/workspaces/gowork/src/github.com/xxf098/v2ray-core/go.mod: no such file or directory

查看go.mod文件replace处,是否缺少依赖?lite分支

make ios 构建失败

$ make ios
mkdir -p /Users/xxxx/Downloads/go-tun2socks-build/build
eval "cd /Users/xxxx/Downloads/go-tun2socks-build/build && gomobile bind -a -ldflags '-s -w -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn' -target=ios -o /Users/xxxx/Downloads/go-tun2socks-build/build/Tun2socks.framework github.com/xxf098/go-tun2socks-build"
/bin/sh: gomobile: command not found
make: *** [ios] Error 127
$ go get golang.org/x/mobile/cmd/gomobile
$ gomobile init
xxxx@Mac-mini ~ % go get golang.org/x/mobile/cmd/gomobile
xxxx@Mac-mini ~ % gomobile init
zsh: command not found: gomobile

$ go env Output
                     
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/xxxx/Library/Caches/go-build"
GOENV="/Users/xxxx/Library/Application Support/go/env"
GOEXE=""
GOFLAGS="-mod=mod"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/xxxx/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/xxxx/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/Cellar/[email protected]/1.16.14/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/[email protected]/1.16.14/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.14"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/xxxx/Downloads/go-tun2socks-build/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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/tn/jgrzgk7j4mx9szrz97lbnyc00000gn/T/go-build2563246633=/tmp/go-build -gno-record-gcc-switches -fno-common"

Query stats

Hello, what parameters does Tun2socks.querystats() take.
And as a suggestion, how about making a brief documentation for such stuff. By the way, this is so far the best tun2socks implementation with v2ray support

maven repository

is there an accessible AAR library published to your local maven repository? if none, please upload one. thank you!

help needed

I try to build using mac with the following command in terminal..

core/go.mod: no such file or directory

IOS compatibility

Is there anyone who used this library as ios framework? is there any ios demo?

get a contact

hello, xxf098, can you gave me a contact, if I have some questions 。my email is wheatj#gmail.com, thank you

COUNTER NAME

Hello, I have a suggestion, how about not using a predefined counter name in the query stats function and allowing it to take a full counter name as a parameter, not just the direct name. Thanks.

关于流量统计问题

type QuerySpeed interface {
UpdateTraffic(up int64, down int64)
}

up down 返回的都是 0
不知是我使用错误还是这个方法没法获取统计

兄弟好像又出问题了

你在upgrade v4.36.2这个版本之后就出现了没法解析dns了
在update go.sum这个版本得时候还没问题
以前启动都会出现
git
现在的版本都不会出现这个了 是不是dns解析模块出了错误

startV2Ray最后一个参数不生效?

我指定了最后一个参数为filesDir.absolutePath。按理应该是 /data/user/0/com.example.xx/files 这个路径啊
我在安卓的raw目录下面有geoip.dat文件,并通过下面的参数把路径传递给Tun2socks了
resources.openRawResource(R.raw.userconfig).use { Tun2socks.startV2Ray(packageFlow,V2rayService(),null,null,it.readBytes(),filesDir.absolutePath) }
为什么会报
I/GoLog: start V instance failed: infra/conf/serial: failed to parse json config > infra/conf: invalid field rule > infra/conf: failed to load GeoIP: cn > infra/conf: failed to load file: geoip.dat > infra/conf: failed to open file: geoip.dat > open /system/bin/geoip.dat: no such file or directory
这样的错误,/system/bin 这个路径从何来的

配置里用域名的话会导致没网

failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://我的域名/): > dial tcp: lookup 我的域名 on [::1]:53: read udp [::]:54255: i/o timeout transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://我的域名/): > dial tcp: i/o timeout transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://我的域名/): > dial tcp: lookup 我的域名 on [::1]:53: read udp [::]:49887: i/o timeout transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://我的域名/): > dial tcp: i/o timeout transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://我的域名/): > dial tcp: lookup 我的域名 on [::1]:53: read udp [::]:42366: i/o timeout] > common/retry: all retry attempts failed
以下是我得配置

{
  "dns": {
    "hosts": {
      "domain:googleapis.cn": "googleapis.com"
    },
    "servers": [
      "223.5.5.5"
    ]
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 10808,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true,
        "userLevel": 8
      },
      "sniffing": {
        "destOverride": [
          "http",
          "tls"
        ],
        "enabled": true
      },
      "tag": "socks"
    },
    {
      "listen": "127.0.0.1",
      "port": 10809,
      "protocol": "http",
      "settings": {
        "userLevel": 8
      },
      "tag": "http"
    },
    {
      "listen": "127.0.0.1",
      "port": 10853,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "223.5.5.5",
        "network": "tcp,udp",
        "port": 53
      },
      "tag": "dns-in"
    }
  ],
  "log": {
    "loglevel": "warning"
  },
  "outbounds": [
    {
      "mux": {
        "concurrency": 8,
        "enabled": false
      },
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "我的域名",
            "port": 443,
            "users": [
              {
                "alterId": 64,
                "encryption": "",
                "flow": "",
                "id": "b831381d-6324-4d53-ad4f-8cda48b30811",
                "level": 8,
                "security": "chacha20-poly1305"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
          "allowInsecure": false,
          "serverName": ""
        },
        "wsSettings": {
          "headers": {
            "Host": "我的域名"
          },
          "path": "/"
        }
      },
      "tag": "proxy"
    },
    {
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": {
        "response": {
          "type": "http"
        }
      },
      "tag": "block"
    },
    {
      "protocol": "dns",
      "tag": "dns-out"
    }
  ],
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "inboundTag": [
          "dns-in"
        ],
        "outboundTag": "dns-out",
        "type": "field"
      },
      {
        "ip": [
          "223.5.5.5"
        ],
        "outboundTag": "proxy",
        "port": "53",
        "type": "field"
      }
    ]
  }
}

我在网上找到得都是tcp: lookup 域名 on 114.114.114.114:53
而本项目得却出现tcp: lookup 域名 on [::1]:53
不知是我配置问题还是项目得bug

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.