You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kayos@tcp.direct 7231d70a5c
Retract
1 day ago
.github/workflows fix ci 2 years ago
_example update module path 3 months ago
bufferpool add associate test 3 years ago
ccsocks5 update module path 3 months ago
statute fix ci 2 years ago
testing update module path 3 months ago
.gitignore use buffer pool interface 3 years ago
.golangci.yaml fix ci 2 years ago
.revive.sh upgrade package 2 years ago
.revive.toml fix ci 2 years ago
.travis.yml fix ci 2 years ago
LICENSE Initial commit 9 years ago
README.md Boop 1 day ago
auth.go update module path 3 months ago
auth_test.go update module path 3 months ago
credentials.go add more test 3 years ago
credentials_test.go add more test 3 years ago
go.mod Retract 1 day ago
go.sum Retract 1 day ago
handle.go update module path 3 months ago
handle_test.go update module path 3 months ago
logger.go add user handle 3 years ago
option.go update module path 3 months ago
resolver.go add user handle 3 years ago
resolver_test.go add more test 3 years ago
ruleset.go update module path 3 months ago
ruleset_test.go update module path 3 months ago
server.go update module path 3 months ago
server_test.go update module path 3 months ago

README.md

go-socks5 (fork)

GoDoc Go.Dev reference Build Status Action Status codecov Go Report Card License Tag

Provides the socks5 package that implements a SOCKS5. 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:

  • Support client(under ccsocks5 directory) and server(under root directory)
  • Support TCP/UDP and IPv4/IPv6
  • Unit tests
  • "No Auth" mode
  • User/Password authentication optional user addr limit
  • Support for the CONNECT command
  • Support for the ASSOCIATE command
  • Rules to do granular filtering of commands
  • Custom DNS resolution
  • Custom goroutine pool
  • buffer pool design and optional custom buffer pool
  • Custom logger

TODO

The package still needs the following:

  • Support for the BIND command

Installation

Use go get.

    go get github.com/thinkgos/go-socks5

Then import the socks5 server package into your own code.

    import "github.com/thinkgos/go-socks5"

or

import the socks5 client package into your own code.

    import "github.com/thinkgos/go-socks5/ccsocks5"

Example

Below is a simple example of usage, more see example

    // Server: 

    // Create a SOCKS5 server
    server := socks5.NewServer()
    
    // Create SOCKS5 proxy on localhost port 8000
    if err := server.ListenAndServe("tcp", ":8000"); err != nil {
      panic(err)
    }
   // Client: 
   client := ccsocks5.NewClient("127.0.0.1:10800")
    conn, err := client.Dial("tcp", "127.0.0.1:12345") // server you want to visitor
    if err != nil {
    	panic(err)
    }
    conn.Write([]byte("hahaha"))
    time.Sleep(time.Second)

Reference