FlowerWrong / tun2socks

Redirect tun flow to socks 5 in golang, support tcp and udp.
420 stars 108 forks source link

[Raspberry pi 3 b+] Golang errors #62

Open 0x90asm opened 5 years ago

0x90asm commented 5 years ago

I've installed the latest Golang version:

pi@raspberrypi:~/go/src/github.com/FlowerWrong/tun2socks $ go version
go version go1.12.4 linux/arm

Following the "how to use it" section, got the following errors:

pi@raspberrypi:~/go/src/github.com/FlowerWrong/tun2socks $ go get ./...
# github.com/google/netstack/tcpip/link/rawfile
../../google/netstack/tcpip/link/rawfile/rawfile_unsafe.go:81:4: cannot use uint64(len(b1)) (type uint64) as type uint32 in field value
../../google/netstack/tcpip/link/rawfile/rawfile_unsafe.go:85:4: cannot use uint64(len(b2)) (type uint64) as type uint32 in field value
../../google/netstack/tcpip/link/rawfile/rawfile_unsafe.go:93:16: cannot use uint64(len(b3)) (type uint64) as type uint32 in assignment
# github.com/FlowerWrong/netstack/tcpip/transport/tcp
../netstack/tcpip/transport/tcp/snd.go:186:3: constant 9223372036854775807 overflows int
# github.com/FlowerWrong/tun2socks/util
util/port.go:10:26: cannot use func literal (type func(uint16) (bool, *"github.com/FlowerWrong/netstack/tcpip".Error)) as type func(uint16) (bool, *"github.com/google/netstack/tcpip".Error) in argument to stack.PortManager.PickEphemeralPort
# github.com/FlowerWrong/tun2socks/cmd/surge
cmd/surge/parser.go:22:6: main redeclared in this block
        previous declaration at cmd/surge/jsbox.go:67:6
cmd/surge/parser.go:133:13: too many arguments in call to writeToFile
        have (*os.File, []string, string, string)
        want (*os.File, string)
cmd/surge/parser.go:134:13: too many arguments in call to writeToFile
        have (*os.File, []string, string, string)
        want (*os.File, string)
cmd/surge/parser.go:135:13: too many arguments in call to writeToFile
        have (*os.File, []string, string, string)
        want (*os.File, string)
cmd/surge/parser.go:137:13: too many arguments in call to writeToFile
        have (*os.File, []string, string, string)
        want (*os.File, string)
cmd/surge/parser.go:138:13: too many arguments in call to writeToFile
        have (*os.File, []string, string, string)
        want (*os.File, string)
cmd/surge/parser.go:139:13: too many arguments in call to writeToFile
        have (*os.File, []string, string, string)
        want (*os.File, string)
cmd/surge/parser.go:141:13: too many arguments in call to writeToFile
        have (*os.File, []string, string, string)
        want (*os.File, string)
cmd/surge/parser.go:142:13: too many arguments in call to writeToFile
        have (*os.File, []string, string, string)
        want (*os.File, string)
cmd/surge/parser.go:185:6: writeToFile redeclared in this block
        previous declaration at cmd/surge/jsbox.go:41:38
cmd/surge/parser.go:142:13: too many errors
# github.com/FlowerWrong/tun2socks/cmd/udp
cmd/udp/server.go:8:6: main redeclared in this block
        previous declaration at cmd/udp/client.go:31:6

Would you recommend a solution?

FlowerWrong commented 5 years ago

Because of the changes of netstack, there are lots of work to do for support linux arm. eg vnetHdrToByteSlice, If you are familiar with golang, you can try the master branch of netstack, and you should edit a little file of tun2socks, eg arguments.

FlowerWrong commented 5 years ago

Also, you can try https://github.com/FlowerWrong/tun2socks/releases/tag/0.7 this version, but I am not sure.