1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00
v2fly/net/socks/config.go
2015-09-12 11:51:42 +02:00

23 lines
402 B
Go

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
}