mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
code optimize
This commit is contained in:
parent
27a2d2c0f5
commit
025e750ebe
@ -5,6 +5,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
C "github.com/sagernet/sing-box/constant"
|
||||||
"github.com/sagernet/sing-box/option"
|
"github.com/sagernet/sing-box/option"
|
||||||
"github.com/sagernet/sing/common"
|
"github.com/sagernet/sing/common"
|
||||||
E "github.com/sagernet/sing/common/exceptions"
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
@ -37,7 +38,7 @@ type ShadowSocks struct {
|
|||||||
// Options implements Link
|
// Options implements Link
|
||||||
func (l *ShadowSocks) Options() *option.Outbound {
|
func (l *ShadowSocks) Options() *option.Outbound {
|
||||||
return &option.Outbound{
|
return &option.Outbound{
|
||||||
Type: "shadowsocks",
|
Type: C.TypeShadowsocks,
|
||||||
Tag: l.Ps,
|
Tag: l.Ps,
|
||||||
ShadowsocksOptions: option.ShadowsocksOutboundOptions{
|
ShadowsocksOptions: option.ShadowsocksOutboundOptions{
|
||||||
ServerOptions: option.ServerOptions{
|
ServerOptions: option.ServerOptions{
|
||||||
|
@ -23,7 +23,7 @@ type Vmess struct {
|
|||||||
// Options implements Link
|
// Options implements Link
|
||||||
func (v *Vmess) Options() *option.Outbound {
|
func (v *Vmess) Options() *option.Outbound {
|
||||||
out := &option.Outbound{
|
out := &option.Outbound{
|
||||||
Type: "vmess",
|
Type: C.TypeVMess,
|
||||||
Tag: v.Tag,
|
Tag: v.Tag,
|
||||||
VMessOptions: option.VMessOutboundOptions{
|
VMessOptions: option.VMessOutboundOptions{
|
||||||
ServerOptions: option.ServerOptions{
|
ServerOptions: option.ServerOptions{
|
||||||
@ -38,6 +38,7 @@ func (v *Vmess) Options() *option.Outbound {
|
|||||||
|
|
||||||
if v.TLS {
|
if v.TLS {
|
||||||
out.VMessOptions.TLS = &option.OutboundTLSOptions{
|
out.VMessOptions.TLS = &option.OutboundTLSOptions{
|
||||||
|
Enabled: true,
|
||||||
Insecure: v.TLSAllowInsecure,
|
Insecure: v.TLSAllowInsecure,
|
||||||
ServerName: v.Host,
|
ServerName: v.Host,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user