Skip to content

Commit 0b792ba

Browse files
committed
move to things-go
1 parent 0fc8789 commit 0b792ba

21 files changed

+82
-64
lines changed

Diff for: .github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
go-version: ["1.13.x", "1.14.x", "1.15.x"]
10+
go-version: ["1.15.x", "1.16.x"]
1111

1212
steps:
1313
- name: Set up Go ${{matrix.go-version}}

Diff for: .travis.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ os:
66
- linux
77

88
go:
9-
- 1.14.x
109
- 1.15.x
11-
12-
go_import_path: github.com/thinkgos/go-socks5
10+
- 1.16.x
1311

1412
before_install:
1513
- if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go";
@@ -18,7 +16,7 @@ before_install:
1816

1917
install:
2018
- go get -u golang.org/x/lint/golint
21-
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0
19+
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
2220
- curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
2321

2422
script:
@@ -41,5 +39,4 @@ after_success:
4139

4240
env:
4341
global:
44-
- GO111MODULE=on
45-
- secure: u1rSojKLa1qhE+L+kuXzPbp1Q2GljTdu7GAC0vmMLBhNXX9masBiEisOKz3GQtaz0SY031u05/UA2MS7WVdru0vEL6v6pAKQkKbtg/m4DbspwD9aIUlZMs7BJpkHegGnS/gQh2hyPTYPAMfjPWqvFDYrZ+lbZrz5l3B6Wfi0CeVT5EKLrWvjzsottaQSi3Yby4uMDolCYe4LETrQ98SRBB4M0JBZdmn38S/NdxQefCVICSjaG30UyxKmYp7BzYzZ/Dp+O1UDdOlg8Y2J0emN4Jz5k8O+6GTP3riKzw0pMl57mcFkL5axn4YumSpE42w5/lNTrMvcp/ez5boKt84QTuSliZZkPoeF/9y9gTTmSXc02rMXOWJvXeInCqxJv7Awv8YeZiZQnv3gPY/ZcsdIIRp25UcLIsLh50CEG3Tdm+c7dwDv8x7qnaphzRdzcEDoOmatqKSc1QcmWeoagpKp04y2Uop4L8T8bBw+vdL+0Wis/7uWzAb9Ic/TbUhM8KA86Uuklk7u0xk8s2WAR2m69l6l41F5X9Fg8IG3fKgvjzF9eMVOFc6ThKZKJsH9ZZDaKfZjIjRrvXcPXXQdiudrS4g6PsYoTx3i06Yj70hjrAD6GhaWBb98DEzYN4dSIthO1sqPFVQO3s2yQrerxV0u9zxWdGIMYMfBlWpUyZTtX1o=
42+
- GO111MODULE=on

Diff for: README.md

+52-31
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# go-socks5
22

3-
[![GoDoc](https://godoc.org/github.com/thinkgos/go-socks5?status.svg)](https://godoc.org/github.com/thinkgos/go-socks5)
4-
[![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-blue?logo=go&logoColor=white)](https://pkg.go.dev/github.com/thinkgos/go-socks5?tab=doc)
5-
[![Build Status](https://travis-ci.org/thinkgos/go-socks5.svg?branch=master)](https://travis-ci.org/thinkgos/go-socks5)
6-
![Action Status](https://github.com/thinkgos/go-socks5/workflows/Go/badge.svg)
7-
[![codecov](https://codecov.io/gh/thinkgos/go-socks5/branch/master/graph/badge.svg)](https://codecov.io/gh/thinkgos/go-socks5)
8-
[![Go Report Card](https://goreportcard.com/badge/github.com/thinkgos/go-socks5)](https://goreportcard.com/report/github.com/thinkgos/go-socks5)
9-
[![License](https://img.shields.io/github/license/thinkgos/go-socks5)](https://github.com/thinkgos/go-socks5/raw/master/LICENSE)
10-
[![Tag](https://img.shields.io/github/v/tag/thinkgos/go-socks5)](https://github.com/thinkgos/go-socks5/tags)
3+
[![GoDoc](https://godoc.org/github.com/things-go/go-socks5?status.svg)](https://godoc.org/github.com/things-go/go-socks5)
4+
[![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-blue?logo=go&logoColor=white)](https://pkg.go.dev/github.com/things-go/go-socks5?tab=doc)
5+
[![Build Status](https://travis-ci.com/things-go/go-socks5.svg?branch=master)](https://travis-ci.com/things-go/go-socks5)
6+
![Action Status](https://github.com/things-go/go-socks5/workflows/Go/badge.svg)
7+
[![codecov](https://codecov.io/gh/things-go/go-socks5/branch/master/graph/badge.svg)](https://codecov.io/gh/things-go/go-socks5)
8+
[![Go Report Card](https://goreportcard.com/badge/github.com/things-go/go-socks5)](https://goreportcard.com/report/github.com/things-go/go-socks5)
9+
[![License](https://img.shields.io/github/license/things-go/go-socks5)](https://github.com/things-go/go-socks5/raw/master/LICENSE)
10+
[![Tag](https://img.shields.io/github/v/tag/things-go/go-socks5)](https://github.com/things-go/go-socks5/tags)
1111

1212
Provides the `socks5` package that implements a [SOCKS5](http://en.wikipedia.org/wiki/SOCKS).
1313
SOCKS (Secure Sockets) is used to route traffic between a client and server through
@@ -39,51 +39,72 @@ The package still needs the following:
3939

4040
Use go get.
4141
```bash
42-
go get github.com/thinkgos/go-socks5
42+
go get github.com/things-go/go-socks5
4343
```
4444

4545
Then import the socks5 server package into your own code.
4646

4747
```bash
48-
import "github.com/thinkgos/go-socks5"
48+
import "github.com/things-go/go-socks5"
4949
```
5050

5151
or
5252

5353
import the socks5 client package into your own code.
5454

5555
```bash
56-
import "github.com/thinkgos/go-socks5/ccsocks5"
56+
import "github.com/things-go/go-socks5/ccsocks5"
5757
```
5858

5959
### Example
6060

61-
Below is a simple example of usage, more see [example](https://github.com/thinkgos/go-socks5/tree/master/_example)
62-
61+
Below is a simple example of usage, more see [example](https://github.com/things-go/go-socks5/tree/master/_example)
6362

63+
[embedmd]:# (_example/server/main.go go)
6464
```go
65-
// Server:
66-
67-
// Create a SOCKS5 server
68-
server := socks5.NewServer()
69-
70-
// Create SOCKS5 proxy on localhost port 8000
71-
if err := server.ListenAndServe("tcp", ":8000"); err != nil {
72-
panic(err)
73-
}
65+
package main
66+
67+
import (
68+
"log"
69+
"os"
70+
71+
"github.com/things-go/go-socks5"
72+
)
73+
74+
func main() {
75+
// Create a SOCKS5 server
76+
server := socks5.NewServer(
77+
socks5.WithLogger(socks5.NewLogger(log.New(os.Stdout, "socks5: ", log.LstdFlags))),
78+
)
79+
80+
// Create SOCKS5 proxy on localhost port 8000
81+
if err := server.ListenAndServe("tcp", ":10800"); err != nil {
82+
panic(err)
83+
}
84+
}
7485
```
7586

87+
[embedmd]:# (_example/client/main.go go)
7688
```go
77-
// Client:
78-
client := ccsocks5.NewClient("127.0.0.1:10800")
79-
conn, err := client.Dial("tcp", "127.0.0.1:12345") // server you want to visitor
80-
if err != nil {
81-
panic(err)
82-
}
83-
conn.Write([]byte("hahaha"))
84-
time.Sleep(time.Second)
89+
package main
90+
91+
import (
92+
"time"
93+
94+
"github.com/things-go/go-socks5/ccsocks5"
95+
)
96+
97+
func main() {
98+
client := ccsocks5.NewClient("127.0.0.1:10800")
99+
conn, err := client.Dial("tcp", "127.0.0.1:12345") // server you want to visitor
100+
if err != nil {
101+
panic(err)
102+
}
103+
conn.Write([]byte("hahaha"))
104+
time.Sleep(time.Second)
105+
}
85106
```
86107

87108
### Reference
88109
- [rfc1928](https://www.ietf.org/rfc/rfc1928.txt)
89-
- original armon [go-sock5](https://github.com/armon/go-socks5)
110+
- original armon [go-sock5](https://github.com/armon/go-socks5)

Diff for: _example/client/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"time"
55

6-
"github.com/thinkgos/go-socks5/ccsocks5"
6+
"github.com/things-go/go-socks5/ccsocks5"
77
)
88

99
func main() {

Diff for: _example/server/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"log"
55
"os"
66

7-
"github.com/thinkgos/go-socks5"
7+
"github.com/things-go/go-socks5"
88
)
99

1010
func main() {

Diff for: _example/testassociate/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"os"
88
"time"
99

10-
"github.com/thinkgos/go-socks5"
11-
"github.com/thinkgos/go-socks5/ccsocks5"
10+
"github.com/things-go/go-socks5"
11+
"github.com/things-go/go-socks5/ccsocks5"
1212
)
1313

1414
func handleErr(err error) {

Diff for: _example/testconnect/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"os"
88
"time"
99

10-
"github.com/thinkgos/go-socks5"
11-
"github.com/thinkgos/go-socks5/ccsocks5"
10+
"github.com/things-go/go-socks5"
11+
"github.com/things-go/go-socks5/ccsocks5"
1212
)
1313

1414
func handleErr(err error) {

Diff for: auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package socks5
33
import (
44
"io"
55

6-
"github.com/thinkgos/go-socks5/statute"
6+
"github.com/things-go/go-socks5/statute"
77
)
88

99
// AuthContext A Request encapsulates authentication state provided

Diff for: auth_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/stretchr/testify/assert"
99
"github.com/stretchr/testify/require"
1010

11-
"github.com/thinkgos/go-socks5/statute"
11+
"github.com/things-go/go-socks5/statute"
1212
)
1313

1414
func TestNoAuth(t *testing.T) {

Diff for: ccsocks5/client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"golang.org/x/net/proxy"
99

10-
"github.com/thinkgos/go-socks5/bufferpool"
11-
"github.com/thinkgos/go-socks5/statute"
10+
"github.com/things-go/go-socks5/bufferpool"
11+
"github.com/things-go/go-socks5/statute"
1212
)
1313

1414
// Client is socks5 client.

Diff for: ccsocks5/option.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package ccsocks5
33
import (
44
"golang.org/x/net/proxy"
55

6-
"github.com/thinkgos/go-socks5/bufferpool"
6+
"github.com/things-go/go-socks5/bufferpool"
77
)
88

99
// Option user's option of the client

Diff for: ccsocks5/underconn.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package ccsocks5
33
import (
44
"net"
55

6-
"github.com/thinkgos/go-socks5/bufferpool"
7-
"github.com/thinkgos/go-socks5/statute"
6+
"github.com/things-go/go-socks5/bufferpool"
7+
"github.com/things-go/go-socks5/statute"
88
)
99

1010
// underConnect under connect

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/thinkgos/go-socks5
1+
module github.com/things-go/go-socks5
22

33
go 1.14
44

Diff for: handle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99
"sync"
1010

11-
"github.com/thinkgos/go-socks5/statute"
11+
"github.com/things-go/go-socks5/statute"
1212
)
1313

1414
// AddressRewriter is used to rewrite a destination transparently

Diff for: handle_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010

1111
"github.com/stretchr/testify/require"
1212

13-
"github.com/thinkgos/go-socks5/bufferpool"
14-
"github.com/thinkgos/go-socks5/statute"
13+
"github.com/things-go/go-socks5/bufferpool"
14+
"github.com/things-go/go-socks5/statute"
1515
)
1616

1717
type MockConn struct {

Diff for: option.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"io"
66
"net"
77

8-
"github.com/thinkgos/go-socks5/bufferpool"
8+
"github.com/things-go/go-socks5/bufferpool"
99
)
1010

1111
// Option user's option

Diff for: ruleset.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package socks5
33
import (
44
"context"
55

6-
"github.com/thinkgos/go-socks5/statute"
6+
"github.com/things-go/go-socks5/statute"
77
)
88

99
// RuleSet is used to provide custom rules to allow or prohibit actions

Diff for: ruleset_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/stretchr/testify/require"
88

9-
"github.com/thinkgos/go-socks5/statute"
9+
"github.com/things-go/go-socks5/statute"
1010
)
1111

1212
func TestPermitCommand(t *testing.T) {

Diff for: server.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"log"
1111
"net"
1212

13-
"github.com/thinkgos/go-socks5/bufferpool"
14-
"github.com/thinkgos/go-socks5/statute"
13+
"github.com/things-go/go-socks5/bufferpool"
14+
"github.com/things-go/go-socks5/statute"
1515
)
1616

1717
// GPool is used to implement custom goroutine pool default use goroutine

Diff for: server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/stretchr/testify/require"
1515
"golang.org/x/net/proxy"
1616

17-
"github.com/thinkgos/go-socks5/statute"
17+
"github.com/things-go/go-socks5/statute"
1818
)
1919

2020
func TestSOCKS5_Connect(t *testing.T) {

Diff for: testing/socks5_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
"github.com/stretchr/testify/require"
1313
"golang.org/x/net/proxy"
1414

15-
"github.com/thinkgos/go-socks5"
16-
"github.com/thinkgos/go-socks5/bufferpool"
17-
"github.com/thinkgos/go-socks5/ccsocks5"
15+
"github.com/things-go/go-socks5"
16+
"github.com/things-go/go-socks5/bufferpool"
17+
"github.com/things-go/go-socks5/ccsocks5"
1818
)
1919

2020
func Test_Socks5_Connect(t *testing.T) {

0 commit comments

Comments
 (0)