mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-09 11:46:42 -05:00
23 lines
402 B
Go
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
|
|
}
|