1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-15 05:35:48 -05:00

Massive refactoring for better code structure

This commit is contained in:
V2Ray
2015-09-19 23:54:36 +02:00
parent 5eee1b97aa
commit 075753c030
34 changed files with 107 additions and 115 deletions

22
proxy/socks/config.go Normal file
View File

@@ -0,0 +1,22 @@
package socks
import (
"encoding/json"
)
const (
JsonAuthMethodNoAuth = "noauth"
JsonAuthMethodUserPass = "password"
)
type SocksConfig struct {
AuthMethod string `json:"auth"`
Username string `json:"user"`
Password string `json:"pass"`
}
func loadConfig(rawConfig []byte) (SocksConfig, error) {
config := SocksConfig{}
err := json.Unmarshal(rawConfig, &config)
return config, err
}