1

I want to create a tor like clone in Go, where I have a local socks5 proxy server from which I get the request, encrypt it and send it via tcp to the network. To work with proxies in go I found the golang.org/x/net/proxy package. By searching how to create a server with it and getting the request data I only find something like this Creating a go socks5 client where people use it to only forward the traffic to another server.

Currently I have this implementation.

dialer, err := proxy.SOCKS5("tcp", "127.0.0.1:31415", nil, proxy.Direct)
if err != nil {
    panic(err)
}

My question now is how I can get the data which the computer send via socks5 to this local proxy.

  • The package x/net/proxy does not implement a socks proxy, it only implements a client able to use a proxy. But [a quick search](https://www.google.com/search?q=golang+implement+socks5+proxy) provides several implementations, like [this](https://github.com/things-go/go-socks5) or [this](https://github.com/ziozzang/socks5-proxy) or [this](https://github.com/oov/socks5). And [here](https://www.sobyte.net/post/2022-01/go-socket5/) it is explained how to write your own. – Steffen Ullrich Oct 23 '22 at 15:58
  • I hope this helps -> https://pkg.go.dev/v2ray.com/core/proxy/socks – NikzJon Oct 23 '22 at 20:57
  • https://www.sobyte.net/post/2022-01/go-socket5/ This shows the basic implementation of socks5. – NikzJon Oct 23 '22 at 21:05

0 Answers0