Skip to content
Discussion options

You must be logged in to vote

OK - i found a solution.

s = str(await reader.read(30))

MUST for firefox be:

s = str(await reader.read(-1))

If you won't get everything from the clientbuffer. Firefox will stop with this error, because his connection will not be closed.

The hole code to handle the HTML Request is:

async def httpLoop(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter):
        try:
            self.ms.log("HTTP-Client Connected...")
            s = str(await reader.read(-1))
            self.ms.log(s)

            if s.startswith("b'GET / "):
                self.ms.log("Reading Path / . Send: ")
                await writer.awrite('HTTP/1.1 200 OK\r\n')
                await writer.awrite('C…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@milo1987
Comment options

Comment options

You must be logged in to vote
1 reply
@milo1987
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by milo1987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants