-
-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Go | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15.x | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache go module | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Get dependencies, run test and static check | ||
run: | | ||
go test ./... | ||
go vet ./... | ||
go get -u honnef.co/go/tools/cmd/staticcheck | ||
staticcheck -- $(go list ./...) | ||
- name: Build | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
DIR: bin | ||
NAME: tun2socks | ||
run: make -j releases | ||
|
||
- name: Upload Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: bin/* | ||
draft: true | ||
prerelease: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,74 @@ | ||
# tun2socks | ||
|
||
 | ||
 | ||
 | ||
 | ||
|
||
A tun2socks implementation written in Go. | ||
|
||
## Features | ||
|
||
- External RESTful API support | ||
- Fake DNS with manual hosts support | ||
- IPv4/IPv6 support | ||
- Optimized UDP transmission for game acceleration | ||
- Pure Go implementation, no CGO required | ||
- Socks5, Shadowsocks protocol support for remote connections | ||
- TCP/IP stack powered by [gVisor](https://github.com/google/gvisor) | ||
- Up to 2.5Gbps throughput (10x faster than [v1](https://github.com/xjasonlyu/tun2socks/tree/v1)) | ||
|
||
### Requirements | ||
|
||
| Target | Minimum | Recommended | | ||
| --- | --- | --- | | ||
| System | linux darwin | linux | | ||
| Memory | >20MB | +∞ | | ||
| CPU | ANY | amd64 arm64 | | ||
|
||
## QuickStart | ||
|
||
Download from precompiled [Releases](https://github.com/xjasonlyu/tun2socks/releases). | ||
|
||
create tun | ||
|
||
```shell script | ||
ip tuntap add mode tun dev tun0 | ||
ip addr add 198.18.0.1/15 dev tun0 | ||
ip link set dev tun0 up | ||
``` | ||
|
||
run | ||
|
||
```shell script | ||
./tun2socks --loglevel WARN --device tun://tun0 --proxy socks5://server:port --interface eth0 | ||
``` | ||
|
||
or just | ||
|
||
```shell script | ||
PROXY=socks5://server:port LOGLEVEL=WARN sh ./scripts/entrypoint.sh | ||
``` | ||
|
||
## Build from source | ||
|
||
```text | ||
$ git clone https://github.com/xjasonlyu/tun2socks.git | ||
$ cd tun2socks | ||
$ make | ||
``` | ||
|
||
## Issues | ||
|
||
Due to the implementation of pure Go, the memory usage is higher than the previous version. | ||
If you are memory sensitive, please go back to [v1](https://github.com/xjasonlyu/tun2socks/tree/v1). | ||
|
||
## TODO | ||
|
||
- [ ] Windows support | ||
|
||
## Credits | ||
|
||
- [Dreamacro/clash](https://github.com/Dreamacro/clash) | ||
- [google/gvisor](https://github.com/google/gvisor) | ||
- [majek/slirpnetstack](https://github.com/majek/slirpnetstack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters