1
0
Fork 0
Go to file
ymmt2005 66ca0497df Let proxy pass down EOF (FIN) to the other end.
This PR improves proxy() implementation so that it passes down EOF
(i.e. TCP FIN) from the read end to the write end by using
TCPConn.CloseWrite().  This is a must for TCP proxy as TCP sockets
can be half-closed.

Moreover, Server.handleConnect() should wait for two acks from
errCh to guarantee that the communication is completely over.
This is also fixed.

Lastly, noisy debug log is removed.
2016-02-23 20:35:36 +09:00
.gitignore Initial commit 2014-01-22 15:49:51 -08:00
.travis.yml Adding Travis CI support 2014-01-23 14:25:04 -08:00
LICENSE Initial commit 2014-01-22 15:49:51 -08:00
README.md Usage example 2014-06-27 13:39:00 +08:00
auth.go Introduce AuthContext struct and refactor auth api using it 2016-01-11 20:52:06 +13:00
auth_test.go Introduce AuthContext struct and refactor auth api using it 2016-01-11 20:52:06 +13:00
credentials.go Adding simple credentials interface 2014-01-23 11:10:54 -08:00
credentials_test.go Adding credentials test 2014-01-23 11:12:28 -08:00
request.go Let proxy pass down EOF (FIN) to the other end. 2016-02-23 20:35:36 +09:00
request_test.go Refactor handleRequest using new Request struct 2016-01-11 21:01:29 +13:00
resolver.go Resolver uses net.IP 2014-01-23 13:07:13 -08:00
resolver_test.go Resolver uses net.IP 2014-01-23 13:07:13 -08:00
ruleset.go Refactor RuleSet api using Request struct 2016-01-11 20:37:41 +13:00
ruleset_test.go Refactor RuleSet api using Request struct 2016-01-11 20:37:41 +13:00
socks5.go Made dialer configurable 2016-02-04 13:25:27 -06:00
socks5_test.go Use new Request struct for the Server api 2016-01-11 21:24:54 +13:00

README.md

go-socks5 Build Status

Provides the socks5 package that implements a SOCKS5 server. SOCKS (Secure Sockets) is used to route traffic between a client and server through an intermediate proxy layer. This can be used to bypass firewalls or NATs.

Feature

The package has the following features:

  • "No Auth" mode
  • User/Password authentication
  • Support for the CONNECT command
  • Rules to do granular filtering of commands
  • Custom DNS resolution
  • Unit tests

TODO

The package still needs the following:

  • Support for the BIND command
  • Support for the ASSOCIATE command

Example

Below is a simple example of usage

// Create a SOCKS5 server
conf := &socks5.Config{}
server, err := socks5.New(conf)
if err != nil {
  panic(err)
}

// Create SOCKS5 proxy on localhost port 8000
if err := server.ListenAndServe("tcp", "127.0.0.1:8000"); err != nil {
  panic(err)
}