mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 14:44:15 +00:00
massive refactoring for configuration
This commit is contained in:
1 parent
791ac780f0
commit
0ca7dab49b
15 files changed
+212
-147
No files matched your search
@@ -1,37 +0,0 @@
|
||||
// Package json contains io library for VConfig in Json format.
|
||||
package json
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
_ "fmt"
|
||||
|
||||
"github.com/v2ray/v2ray-core"
|
||||
)
|
||||
|
||||
type JsonVUser struct {
|
||||
id string `json:"id"`
|
||||
email string `json:"email"`
|
||||
}
|
||||
|
||||
type JsonVConfig struct {
|
||||
Port uint8 `json:"port"`
|
||||
Clients []JsonVUser `json:"users"`
|
||||
Protocol string `json:"protocol"`
|
||||
}
|
||||
|
||||
type JsonVConfigUnmarshaller struct {
|
||||
}
|
||||
|
||||
func StringToVUser(id string) (u core.VUser, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (*JsonVConfigUnmarshaller) Unmarshall(data []byte) (*core.VConfig, error) {
|
||||
var jsonConfig JsonVConfig
|
||||
err := json.Unmarshal(data, &jsonConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var vconfig = new(core.VConfig)
|
||||
return vconfig, nil
|
||||
}
|
||||
+4
-3
@@ -13,9 +13,10 @@ import (
|
||||
const (
|
||||
socksVersion = uint8(5)
|
||||
|
||||
AuthNotRequired = byte(0x00)
|
||||
AuthGssApi = byte(0x01)
|
||||
AuthUserPass = byte(0x02)
|
||||
AuthNotRequired = byte(0x00)
|
||||
AuthGssApi = byte(0x01)
|
||||
AuthUserPass = byte(0x02)
|
||||
AuthNoMatchingMethod = byte(0xFF)
|
||||
)
|
||||
|
||||
// Authentication request header of Socks5 protocol
|
||||
|
||||
Reference in new issue
Block a user