Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VmessIntoOutboundDetour for v2ray json config file generation #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions miniv2ray/v2ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ import (
)

func Vmess2Outbound(v *vmess.VmessLink, useMux, allowInsecure bool) (*core.OutboundHandlerConfig, error) {
out := &conf.OutboundDetourConfig{}
template := &conf.OutboundDetourConfig{}
detour, err := Vmess2OutboundDetour(v, useMux, allowInsecure, template)
if err != nil {
return nil, err
}
return detour.Build()
}

func Vmess2OutboundDetour(v *vmess.VmessLink, useMux, allowInsecure bool, template *conf.OutboundDetourConfig) (*conf.OutboundDetourConfig, error) {
out := template
out.Tag = "proxy"
out.Protocol = "vmess"
out.MuxSettings = &conf.MuxConfig{}
Expand Down Expand Up @@ -105,7 +114,7 @@ func Vmess2Outbound(v *vmess.VmessLink, useMux, allowInsecure bool) (*core.Outbo
]
}`, v.Add, v.Port, v.ID, v.Aid)))
out.Settings = &oset
return out.Build()
return out, nil
}

func StartV2Ray(vm string, verbose, useMux, allowInsecure bool) (*core.Instance, error) {
Expand Down