riobard/go-shadowsocks2

compilation fails

MrBenWang opened this issue · 1 comments

use this command : go get -u github.com/riobard/go-shadowsocks2 attention the github link
the error message : go/src/github.com/riobard/go-shadowsocks2/tcp_linux.go:36: c.SyscallConn undefined (type *net.TCPConn has no field or method SyscallConn)

func getOrigDst(conn net.Conn, ipv6 bool) (socks.Addr, error) {
c, ok := conn.(*net.TCPConn)
if !ok {
return nil, errors.New("only work with TCP connection")
}
rc, err := c.SyscallConn()
if err != nil {
return nil, err
}

but, use use this command : go get -u github.com/shadowsocks/go-shadowsocks2
Installation is successful.
https://github.com/shadowsocks/go-shadowsocks2/blob/90a5b4a50462fbbb14262f386251f056a8678a20/tcp_linux.go#L30-L39

I think the reason is go-version, can you compatible with the old version? like go 1.8

This repo is experimental and it requires latest Go (currently >= 1.10). The stable repo at (https://github.com/shadowsocks/go-shadowsocks2) is more compatible with older Go versions. If you have to use older Go, please consider the stable repo instead.