This commit is contained in:
unknown
2019-10-16 18:47:59 +08:00
parent f0a9f4e471
commit 5e5df224b7
3 changed files with 28 additions and 8 deletions

View File

@@ -19,12 +19,14 @@ type S5Server struct {
listener net.Listener
}
func NewS5Server(globalConfig, clientConfig, pluginConfig map[string]string) *S5Server {
func NewS5Server(globalConfig, clientConfig, pluginConfig map[string]string, ServerIp string, ServerPort int) *S5Server {
s5 := &S5Server{
globalConfig: globalConfig,
clientConfig: clientConfig,
pluginConfig: pluginConfig,
plugins: &core.Plugins{},
ServerIp: ServerIp,
ServerPort: ServerPort,
}
s5.plugins.Add(new(Handshake), new(Access), new(CheckAccess), new(Request), new(common.Proxy))
return s5

View File

@@ -0,0 +1,15 @@
package socks5
import (
"context"
"testing"
)
func TestNewS5Server(t *testing.T) {
g := make(map[string]string)
c := make(map[string]string)
p := make(map[string]string)
s5 := NewS5Server(g, c, p, "", 1099)
ctx := context.Background()
s5.Start(ctx)
}