Compose connect middleware