add go mod

use standard packet context
This commit is contained in:
mo 2020-04-19 17:08:22 +08:00
parent e75332964e
commit b4107cb925
11 changed files with 58 additions and 14 deletions

31
.github/workflows/go.yml vendored Normal file

@ -0,0 +1,31 @@
name: Go
on: [push]
jobs:
build:
name: Build on GO ${{matrix.go-version}}
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.11.x", "1.12.x", "1.13.x", "1.14.x"]
steps:
- name: Set up Go ${{matrix.go-version}}
uses: actions/setup-go@v1
with:
go-version: ${{matrix.go-version}}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Go test
run: go test -v -benchmem -test.bench=".*" -coverprofile=coverage.txt -covermode=atomic ./...

1
.gitignore vendored

@ -20,3 +20,4 @@ _cgo_export.*
_testmain.go
*.exe
.idea

@ -1,4 +1,16 @@
language: go
go:
- 1.1
- tip
- 1.11.x
- 1.12.x
- 1.13.x
- 1.14.x
install:
- go get -t -v ./...
script:
- go test -v -benchmem -test.bench=".*" -coverprofile=coverage.txt -covermode=atomic ./...
after_success:
- bash <(curl -s https://codecov.io/bash)

@ -1,6 +1,8 @@
go-socks5 [![Build Status](https://travis-ci.org/armon/go-socks5.png)](https://travis-ci.org/armon/go-socks5)
go-socks5
=========
[![Build Status](https://travis-ci.org/armon/go-socks5.png)](https://travis-ci.org/armon/go-socks5)
Provides the `socks5` package that implements a [SOCKS5 server](http://en.wikipedia.org/wiki/SOCKS).
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.

3
go.mod Normal file

@ -0,0 +1,3 @@
module github.com/thinkgos/socks5
go 1.14

@ -1,13 +1,12 @@
package socks5
import (
"context"
"fmt"
"io"
"net"
"strconv"
"strings"
"golang.org/x/net/context"
)
const (

@ -1,9 +1,8 @@
package socks5
import (
"context"
"net"
"golang.org/x/net/context"
)
// NameResolver is used to implement custom name resolution

@ -1,9 +1,8 @@
package socks5
import (
"context"
"testing"
"golang.org/x/net/context"
)
func TestDNSResolver(t *testing.T) {

@ -1,7 +1,7 @@
package socks5
import (
"golang.org/x/net/context"
"context"
)
// RuleSet is used to provide custom rules to allow or prohibit actions

@ -1,9 +1,8 @@
package socks5
import (
"context"
"testing"
"golang.org/x/net/context"
)
func TestPermitCommand(t *testing.T) {

@ -2,12 +2,11 @@ package socks5
import (
"bufio"
"context"
"fmt"
"log"
"net"
"os"
"golang.org/x/net/context"
)
const (