Skip to content

Commit

Permalink
vnext Security
Browse files Browse the repository at this point in the history
  • Loading branch information
xxf098 committed Feb 28, 2020
1 parent 6baa11c commit bea96e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ func createVmessOutboundDetourConfig(profile *Vmess) conf.OutboundDetourConfig {
Users: []v2ray.Users{
v2ray.Users{
AlterID: profile.Aid,
Email: "v2ray@email.com",
Email: "xxf098@github.com",
ID: profile.ID,
Security: "auto",
Security: profile.Security,
},
},
},
Expand All @@ -117,6 +117,7 @@ func createVmessOutboundDetourConfig(profile *Vmess) conf.OutboundDetourConfig {
Settings: &outboundsSettingsMsg1,
StreamSetting: &conf.StreamConfig{},
}
// TODO: type = "http"
if profile.Net == "ws" {
transportProtocol := conf.TransportProtocol(profile.Net)
vmessOutboundDetourConfig.StreamSetting = &conf.StreamConfig{
Expand Down
10 changes: 6 additions & 4 deletions tun2socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var v *vcore.Instance
var isStopped = false

const (
v2Assert = "v2ray.location.asset"
v2Asset = "v2ray.location.asset"
)

type errPathObjHolder struct{}
Expand All @@ -56,11 +56,12 @@ type Vmess struct {
Net string
ID string
Type string // headerType
Security string // vnext.Security
Loglevel string
}

// TODO: default value
func NewVmess(Host string, Path string, TLS string, Add string, Port int, Aid int, Net string, ID string, Type string, Loglevel string) *Vmess {
func NewVmess(Host string, Path string, TLS string, Add string, Port int, Aid int, Net string, ID string, Type string, Security string, Loglevel string) *Vmess {
return &Vmess{
Host: Host,
Path: Path,
Expand All @@ -71,6 +72,7 @@ func NewVmess(Host string, Path string, TLS string, Add string, Port int, Aid in
Net: Net,
ID: ID,
Type: Type,
Security: Security,
Loglevel: Loglevel,
}
}
Expand Down Expand Up @@ -648,12 +650,12 @@ func CopyAssets(assetDir string, force bool) error {
}

func initV2Env(assetperfix string) {
if os.Getenv(v2Assert) != "" {
if os.Getenv(v2Asset) != "" {
return
}
//Initialize asset API, Since Raymond Will not let notify the asset location inside Process,
//We need to set location outside V2Ray
os.Setenv(v2Assert, assetperfix)
os.Setenv(v2Asset, assetperfix)
//Now we handle read
v2filesystem.NewFileReader = func(path string) (io.ReadCloser, error) {
if strings.HasPrefix(path, assetperfix) {
Expand Down

0 comments on commit bea96e5

Please sign in to comment.