code optimize

This commit is contained in:
jebbs 2022-10-17 15:09:26 +08:00
parent 27a2d2c0f5
commit 025e750ebe
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import (
"strconv"
"strings"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
@ -37,7 +38,7 @@ type ShadowSocks struct {
// Options implements Link
func (l *ShadowSocks) Options() *option.Outbound {
return &option.Outbound{
Type: "shadowsocks",
Type: C.TypeShadowsocks,
Tag: l.Ps,
ShadowsocksOptions: option.ShadowsocksOutboundOptions{
ServerOptions: option.ServerOptions{

View File

@ -23,7 +23,7 @@ type Vmess struct {
// Options implements Link
func (v *Vmess) Options() *option.Outbound {
out := &option.Outbound{
Type: "vmess",
Type: C.TypeVMess,
Tag: v.Tag,
VMessOptions: option.VMessOutboundOptions{
ServerOptions: option.ServerOptions{
@ -38,6 +38,7 @@ func (v *Vmess) Options() *option.Outbound {
if v.TLS {
out.VMessOptions.TLS = &option.OutboundTLSOptions{
Enabled: true,
Insecure: v.TLSAllowInsecure,
ServerName: v.Host,
}