Icecast Protocol Implementation Help #7086
-
Hello! I'm trying to implement an Icecast server using aiohttp but I'm quite stuck. Let me describe the protocol and where I'm hung up. Protocol is fairly trivial:
I've got a route set up to accept the SOURCE method to my handler which then does something relatively trivial: async def icecast_source_handler(self, request):
response = web.StreamResponse(status=200)
await response.prepare(request)
reader = request.content
... rest of code here ... but reader is basically not getting new data and ends up being an EmptyStreamReader (I'm guessing because there is no body to read?) How do I hang onto the socket to process more incoming data? FWIW, here is an implementation using http.server. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
A complete client/server example that we can run would help. I'd expect that if the client connection is still open and no EOF has been sent, then Although it sounds like the Icecast protocol should really be using the Expect header, which aiohttp already has extra code to handle (what you describe is basically an expect handler; client sends |
Beta Was this translation helpful? Give feedback.
-
OK, I've pretty much given up on using aiohttp for this project and instead went for a custom asycnio.Protocol. It isn't very smart handling http but it seems to be working well enough for Traktor, MIXX, and butt to use. Thank you for your time. |
Beta Was this translation helpful? Give feedback.
OK, I've pretty much given up on using aiohttp for this project and instead went for a custom asycnio.Protocol. It isn't very smart handling http but it seems to be working well enough for Traktor, MIXX, and butt to use.
Thank you for your time.