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:
22
proxy/socks/config.go
Normal file
22
proxy/socks/config.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user