1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 01:40:44 +00:00
v2fly/vconfig.go
2015-09-12 11:51:42 +02:00

29 lines
672 B
Go

package core
import (
"encoding/json"
)
// VUser is the user account that is used for connection to a VPoint
type VUser struct {
Id VID `json:"id"` // The ID of this VUser.
}
type VConnectionConfig struct {
Protocol string `json:"protocol"`
File string `json:"file"`
}
// VConfig is the config for VPoint server.
type VConfig struct {
Port uint16 `json:"port"` // Port of this VPoint server.
InboundConfig VConnectionConfig `json:"inbound"`
OutboundConfig VConnectionConfig `json:"outbound"`
}
func LoadVConfig(rawConfig []byte) (VConfig, error) {
config := VConfig{}
err := json.Unmarshal(rawConfig, &config)
return config, err
}