package main
import (
"flag"
"github.com/ginuerzh/gost"
"github.com/sirupsen/logrus"
"log"
"net/url"
)
var (
laddr string
)
func init() {
logrus.SetLevel(logrus.TraceLevel)
flag.StringVar(&laddr, "l", "0.0.0.0:10080", "SOCKS5 server address")
flag.Parse()
}
func main() {
logrus.Debugf("running server at: %v", laddr)
ln, err := gost.TCPListener(laddr)
if err != nil {
log.Fatal(err)
}
h := gost.SOCKS5Handler(
gost.UsersHandlerOption(url.UserPassword("admin", "123456")),
)
s := &gost.Server{Listener: ln}
log.Fatal(s.Serve(h))
}
go install github.com/ginuerzh/gost@latest
go: finding module for package github.com/ryanuber/go-glob
go: finding module for package git.torproject.org/pluggable-transports/goptlib.git
go: finding module for package github.com/klauspost/compress/snappy
go: finding module for package github.com/ginuerzh/gosocks4
go: finding module for package github.com/lucas-clemente/quic-go
go: finding module for package git.torproject.org/pluggable-transports/obfs4.git/transports/base
go: finding module for package github.com/miekg/dns
go: finding module for package github.com/ginuerzh/tls-dissector
go: finding module for package github.com/go-log/log
go: finding module for package git.torproject.org/pluggable-transports/obfs4.git/transports/obfs4
go: finding module for package github.com/gobwas/glob
go: finding module for package github.com/ginuerzh/gosocks5
go: finding module for package github.com/shadowsocks/shadowsocks-go/shadowsocks
go: finding module for package golang.org/x/crypto/pbkdf2
go: finding module for package golang.org/x/crypto/ssh
go: finding module for package golang.org/x/net/http2
go: finding module for package gopkg.in/gorilla/websocket.v1
go: finding module for package gopkg.in/xtaci/kcp-go.v2
go: finding module for package gopkg.in/xtaci/smux.v1
go: found git.torproject.org/pluggable-transports/goptlib.git in git.torproject.org/pluggable-transports/goptlib.git v1.2.0
go: found git.torproject.org/pluggable-transports/obfs4.git/transports/base in git.torproject.org/pluggable-transports/obfs4.git v0.0.0-20201207231651-40245c4a1cf2
go: found git.torproject.org/pluggable-transports/obfs4.git/transports/obfs4 in git.torproject.org/pluggable-transports/obfs4.git v0.0.0-20201207231651-40245c4a1cf2
go: found github.com/ginuerzh/gosocks4 in github.com/ginuerzh/gosocks4 v0.0.1
go: found github.com/ginuerzh/gosocks5 in github.com/ginuerzh/gosocks5 v0.2.0
go: found github.com/ginuerzh/tls-dissector in github.com/ginuerzh/tls-dissector v0.0.1
go: found github.com/go-log/log in github.com/go-log/log v0.2.0
go: found github.com/gobwas/glob in github.com/gobwas/glob v0.2.3
go: found github.com/klauspost/compress/snappy in github.com/klauspost/compress v1.13.6
go: found github.com/lucas-clemente/quic-go in github.com/lucas-clemente/quic-go v0.24.0
go: found github.com/miekg/dns in github.com/miekg/dns v1.1.43
go: found github.com/ryanuber/go-glob in github.com/ryanuber/go-glob v1.0.0
go: found github.com/shadowsocks/shadowsocks-go/shadowsocks in github.com/shadowsocks/shadowsocks-go v0.0.0-20200409064450-3e585ff90601
go: found golang.org/x/crypto/pbkdf2 in golang.org/x/crypto v0.0.0-20211202192323-5770296d904e
go: found golang.org/x/crypto/ssh in golang.org/x/crypto v0.0.0-20211202192323-5770296d904e
go: found golang.org/x/net/http2 in golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b
go: found gopkg.in/gorilla/websocket.v1 in gopkg.in/gorilla/websocket.v1 v1.4.0
go: found gopkg.in/xtaci/kcp-go.v2 in gopkg.in/xtaci/kcp-go.v2 v2.0.3
go: found gopkg.in/xtaci/smux.v1 in gopkg.in/xtaci/smux.v1 v1.4.2
go: github.com/ginuerzh/gost imports
git.torproject.org/pluggable-transports/obfs4.git/transports/base: git.torproject.org/pluggable-transports/obfs4.git@v0.0.0-20201207231651-40245c4a1cf2: parsing go.mod:
module declares its path as: gitlab.com/yawning/obfs4.git
but was required as: git.torproject.org/pluggable-transports/obfs4.git