|
|
@ -28,6 +28,8 @@ type DynamicInboundHandler struct { |
|
|
|
lastRefresh time.Time |
|
|
|
lastRefresh time.Time |
|
|
|
mux *mux.Server |
|
|
|
mux *mux.Server |
|
|
|
task *task.Periodic |
|
|
|
task *task.Periodic |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx context.Context |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func NewDynamicInboundHandler(ctx context.Context, tag string, receiverConfig *proxyman.ReceiverConfig, proxyConfig interface{}) (*DynamicInboundHandler, error) { |
|
|
|
func NewDynamicInboundHandler(ctx context.Context, tag string, receiverConfig *proxyman.ReceiverConfig, proxyConfig interface{}) (*DynamicInboundHandler, error) { |
|
|
@ -39,6 +41,7 @@ func NewDynamicInboundHandler(ctx context.Context, tag string, receiverConfig *p |
|
|
|
portsInUse: make(map[net.Port]bool), |
|
|
|
portsInUse: make(map[net.Port]bool), |
|
|
|
mux: mux.NewServer(ctx), |
|
|
|
mux: mux.NewServer(ctx), |
|
|
|
v: v, |
|
|
|
v: v, |
|
|
|
|
|
|
|
ctx: ctx, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mss, err := internet.ToMemoryStreamConfig(receiverConfig.StreamSettings) |
|
|
|
mss, err := internet.ToMemoryStreamConfig(receiverConfig.StreamSettings) |
|
|
@ -134,6 +137,7 @@ func (h *DynamicInboundHandler) refresh() error { |
|
|
|
sniffingConfig: h.receiverConfig.GetEffectiveSniffingSettings(), |
|
|
|
sniffingConfig: h.receiverConfig.GetEffectiveSniffingSettings(), |
|
|
|
uplinkCounter: uplinkCounter, |
|
|
|
uplinkCounter: uplinkCounter, |
|
|
|
downlinkCounter: downlinkCounter, |
|
|
|
downlinkCounter: downlinkCounter, |
|
|
|
|
|
|
|
ctx: h.ctx, |
|
|
|
} |
|
|
|
} |
|
|
|
if err := worker.Start(); err != nil { |
|
|
|
if err := worker.Start(); err != nil { |
|
|
|
newError("failed to create TCP worker").Base(err).AtWarning().WriteToLog() |
|
|
|
newError("failed to create TCP worker").Base(err).AtWarning().WriteToLog() |
|
|
|