refactor: restructure session initialization to avoid circular references

This commit is contained in:
2025-12-04 22:48:15 +07:00
parent 039e979142
commit 7a31047bb9
7 changed files with 229 additions and 219 deletions

View File

@ -30,13 +30,13 @@ type CustomWriter struct {
buf []byte
respHeader *ResponseHeaderFactory
reqHeader *RequestHeaderFactory
interaction interaction.InteractionController
interaction interaction.Controller
respMW []ResponseMiddleware
reqStartMW []RequestMiddleware
reqEndMW []RequestMiddleware
}
func (cw *CustomWriter) SetInteraction(interaction interaction.InteractionController) {
func (cw *CustomWriter) SetInteraction(interaction interaction.Controller) {
cw.interaction = interaction
}
@ -350,7 +350,7 @@ func forwardRequest(cw *CustomWriter, initialRequest *RequestHeaderFactory, sshS
}
}
sshSession.HandleForwardedConnection(cw, channel, cw.RemoteAddr)
sshSession.Forwarder.HandleConnection(cw, channel, cw.RemoteAddr)
return
}