|
|
@@ -28,6 +28,8 @@ type DynamicInboundHandler struct {
|
|
|
lastRefresh time.Time
|
|
|
mux *mux.Server
|
|
|
task *task.Periodic
|
|
|
+
|
|
|
+ ctx context.Context
|
|
|
}
|
|
|
|
|
|
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),
|
|
|
mux: mux.NewServer(ctx),
|
|
|
v: v,
|
|
|
+ ctx: ctx,
|
|
|
}
|
|
|
|
|
|
mss, err := internet.ToMemoryStreamConfig(receiverConfig.StreamSettings)
|
|
|
@@ -134,6 +137,7 @@ func (h *DynamicInboundHandler) refresh() error {
|
|
|
sniffingConfig: h.receiverConfig.GetEffectiveSniffingSettings(),
|
|
|
uplinkCounter: uplinkCounter,
|
|
|
downlinkCounter: downlinkCounter,
|
|
|
+ ctx: h.ctx,
|
|
|
}
|
|
|
if err := worker.Start(); err != nil {
|
|
|
newError("failed to create TCP worker").Base(err).AtWarning().WriteToLog()
|