massive refactoring for configuration

This commit is contained in:
V2Ray committed 2015-09-12 11:51:42 +02:00
1 parent 791ac780f0
commit 0ca7dab49b
15 files changed
+212 -147

No files matched your search

-37
View File
@@ -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
View File
@@ -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