mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-11-20 16:49:12 +00:00
Env: Remove XRAY_CONE_DISABLED (#6110)
https://github.com/XTLS/Xray-core/pull/6057#issuecomment-4364744151 https://github.com/XTLS/Xray-core/pull/6075#issuecomment-4395258425 https://github.com/XTLS/Xray-core/pull/6110#issuecomment-7003152469
This commit is contained in:
@@ -25,7 +25,6 @@ type Server struct {
|
||||
config *ServerConfig
|
||||
validator *Validator
|
||||
policyManager policy.Manager
|
||||
cone bool
|
||||
}
|
||||
|
||||
// NewServer create a new Shadowsocks server.
|
||||
@@ -47,7 +46,6 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
|
||||
config: config,
|
||||
validator: validator,
|
||||
policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),
|
||||
cone: ctx.Value("cone").(bool),
|
||||
}
|
||||
|
||||
return s, nil
|
||||
@@ -185,7 +183,7 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn stat.Connection, dis
|
||||
|
||||
data.UDP = &destination
|
||||
|
||||
if !s.cone || dest == nil {
|
||||
if dest == nil {
|
||||
dest = &destination
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import (
|
||||
type Server struct {
|
||||
config *ServerConfig
|
||||
policyManager policy.Manager
|
||||
cone bool
|
||||
httpServer *http.Server
|
||||
}
|
||||
|
||||
@@ -39,7 +38,6 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
|
||||
s := &Server{
|
||||
config: config,
|
||||
policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),
|
||||
cone: ctx.Value("cone").(bool),
|
||||
}
|
||||
httpConfig := &http.ServerConfig{
|
||||
UserLevel: config.UserLevel,
|
||||
@@ -277,7 +275,7 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn stat.Connection, dis
|
||||
|
||||
payload.UDP = &destination
|
||||
|
||||
if !s.cone || dest == nil {
|
||||
if dest == nil {
|
||||
dest = &destination
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ type Server struct {
|
||||
policyManager policy.Manager
|
||||
validator *Validator
|
||||
fallbacks map[string]map[string]map[string]*Fallback // or nil
|
||||
cone bool
|
||||
}
|
||||
|
||||
// NewServer creates a new trojan inbound handler.
|
||||
@@ -59,7 +58,6 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
|
||||
server := &Server{
|
||||
policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),
|
||||
validator: validator,
|
||||
cone: ctx.Value("cone").(bool),
|
||||
}
|
||||
|
||||
if config.Fallbacks != nil {
|
||||
@@ -302,7 +300,7 @@ func (s *Server) handleUDPPayload(ctx context.Context, sessionPolicy policy.Sess
|
||||
}
|
||||
errors.LogInfo(ctx, "tunnelling request to ", destination)
|
||||
|
||||
if !s.cone || dest == nil {
|
||||
if dest == nil {
|
||||
dest = &destination
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ func init() {
|
||||
type Handler struct {
|
||||
server *protocol.ServerSpec
|
||||
policyManager policy.Manager
|
||||
cone bool
|
||||
encryption *encryption.ClientInstance
|
||||
reverse *Reverse
|
||||
|
||||
@@ -78,7 +77,6 @@ func New(ctx context.Context, config *Config) (*Handler, error) {
|
||||
handler := &Handler{
|
||||
server: server,
|
||||
policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),
|
||||
cone: ctx.Value("cone").(bool),
|
||||
}
|
||||
|
||||
a := handler.server.User.Account.(*vless.MemoryAccount)
|
||||
@@ -300,7 +298,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
||||
clientReader := link.Reader // .(*pipe.Reader)
|
||||
clientWriter := link.Writer // .(*pipe.Writer)
|
||||
trafficState := proxy.NewTrafficState(account.ID.Bytes())
|
||||
if request.Command == protocol.RequestCommandUDP && (requestAddons.Flow == vless.XRV || (h.cone && request.Port != 53 && request.Port != 443)) {
|
||||
if request.Command == protocol.RequestCommandUDP && (requestAddons.Flow == vless.XRV || (request.Port != 53 && request.Port != 443)) {
|
||||
request.Command = protocol.RequestCommandMux
|
||||
request.Address = net.DomainAddress("v1.mux.cool")
|
||||
request.Port = net.Port(666)
|
||||
|
||||
@@ -32,7 +32,6 @@ import (
|
||||
type Handler struct {
|
||||
server *protocol.ServerSpec
|
||||
policyManager policy.Manager
|
||||
cone bool
|
||||
}
|
||||
|
||||
// New creates a new VMess outbound handler.
|
||||
@@ -49,7 +48,6 @@ func New(ctx context.Context, config *Config) (*Handler, error) {
|
||||
handler := &Handler{
|
||||
server: server,
|
||||
policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),
|
||||
cone: ctx.Value("cone").(bool),
|
||||
}
|
||||
|
||||
return handler, nil
|
||||
@@ -143,7 +141,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
||||
}
|
||||
}, sessionPolicy.Timeouts.ConnectionIdle)
|
||||
|
||||
if request.Command == protocol.RequestCommandUDP && h.cone && request.Port != 53 && request.Port != 443 {
|
||||
if request.Command == protocol.RequestCommandUDP && request.Port != 53 && request.Port != 443 {
|
||||
request.Command = protocol.RequestCommandMux
|
||||
request.Address = net.DomainAddress("v1.mux.cool")
|
||||
request.Port = net.Port(666)
|
||||
|
||||
Reference in New Issue
Block a user