mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-26 15:24:44 +00:00
completely remove allow passive connection
This commit is contained in:
8 files changed
+32
-145
No files matched your search
@@ -53,7 +53,7 @@ message ReceiverConfig {
|
||||
AllocationStrategy allocation_strategy = 3;
|
||||
v2ray.core.transport.internet.StreamConfig stream_settings = 4;
|
||||
bool receive_original_destination = 5;
|
||||
bool allow_passive_connection = 6;
|
||||
bool allow_passive_connection = 6 [deprecated=true];
|
||||
}
|
||||
|
||||
message InboundHandlerConfig {
|
||||
|
||||
@@ -37,14 +37,13 @@ func NewAlwaysOnInboundHandler(ctx context.Context, tag string, receiverConfig *
|
||||
if nl.HasNetwork(net.Network_TCP) {
|
||||
log.Debug("Proxyman|DefaultInboundHandler: creating tcp worker on ", address, ":", port)
|
||||
worker := &tcpWorker{
|
||||
address: address,
|
||||
port: net.Port(port),
|
||||
proxy: p,
|
||||
stream: receiverConfig.StreamSettings,
|
||||
recvOrigDest: receiverConfig.ReceiveOriginalDestination,
|
||||
tag: tag,
|
||||
allowPassiveConn: receiverConfig.AllowPassiveConnection,
|
||||
dispatcher: h.mux,
|
||||
address: address,
|
||||
port: net.Port(port),
|
||||
proxy: p,
|
||||
stream: receiverConfig.StreamSettings,
|
||||
recvOrigDest: receiverConfig.ReceiveOriginalDestination,
|
||||
tag: tag,
|
||||
dispatcher: h.mux,
|
||||
}
|
||||
h.workers = append(h.workers, worker)
|
||||
}
|
||||
|
||||
@@ -97,14 +97,13 @@ func (h *DynamicInboundHandler) refresh() error {
|
||||
nl := p.Network()
|
||||
if nl.HasNetwork(v2net.Network_TCP) {
|
||||
worker := &tcpWorker{
|
||||
tag: h.tag,
|
||||
address: address,
|
||||
port: port,
|
||||
proxy: p,
|
||||
stream: h.receiverConfig.StreamSettings,
|
||||
recvOrigDest: h.receiverConfig.ReceiveOriginalDestination,
|
||||
allowPassiveConn: h.receiverConfig.AllowPassiveConnection,
|
||||
dispatcher: h.mux,
|
||||
tag: h.tag,
|
||||
address: address,
|
||||
port: port,
|
||||
proxy: p,
|
||||
stream: h.receiverConfig.StreamSettings,
|
||||
recvOrigDest: h.receiverConfig.ReceiveOriginalDestination,
|
||||
dispatcher: h.mux,
|
||||
}
|
||||
if err := worker.Start(); err != nil {
|
||||
log.Warning("Proxyman:InboundHandler: Failed to create TCP worker: ", err)
|
||||
|
||||
@@ -26,14 +26,13 @@ type worker interface {
|
||||
}
|
||||
|
||||
type tcpWorker struct {
|
||||
address v2net.Address
|
||||
port v2net.Port
|
||||
proxy proxy.Inbound
|
||||
stream *internet.StreamConfig
|
||||
recvOrigDest bool
|
||||
tag string
|
||||
allowPassiveConn bool
|
||||
dispatcher dispatcher.Interface
|
||||
address v2net.Address
|
||||
port v2net.Port
|
||||
proxy proxy.Inbound
|
||||
stream *internet.StreamConfig
|
||||
recvOrigDest bool
|
||||
tag string
|
||||
dispatcher dispatcher.Interface
|
||||
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
@@ -51,7 +50,6 @@ func (w *tcpWorker) callback(conn internet.Connection) {
|
||||
if len(w.tag) > 0 {
|
||||
ctx = proxy.ContextWithInboundTag(ctx, w.tag)
|
||||
}
|
||||
ctx = proxy.ContextWithAllowPassiveConnection(ctx, w.allowPassiveConn)
|
||||
ctx = proxy.ContextWithInboundDestination(ctx, v2net.TCPDestination(w.address, w.port))
|
||||
ctx = proxy.ContextWithSource(ctx, v2net.DestinationFromAddr(conn.RemoteAddr()))
|
||||
if err := w.proxy.Process(ctx, v2net.Network_TCP, conn, w.dispatcher); err != nil {
|
||||
|
||||
Reference in new issue
Block a user