1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-15 17:54:37 -04:00
v2fly/net/socks/config.go

23 lines
402 B
Go
Raw Normal View History

2015-09-12 05:51:42 -04:00
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
}