Closed vrubel closed 6 years ago
Note : I have sometimes problems getting an answer from the websocket when the connection takes too long. The timeout is set to 500ms in JS at function onOpen(evt)
In this case, it is the different behavior in browsers on the PC and in iOS. On a PC all works, in iOS a connection break.
Can you have a debugging information for iOS @vrubel ? I don't have an iPhone for the moment.
WebSocket connection to 'ws://192.168.1.45/' failed: Invalid HTTP version string: HTTP/1.0
` diff --git a/microWebSrv.py b/microWebSrv.py index 2f61358..c218a6f 100755 --- a/microWebSrv.py +++ b/microWebSrv.py @@ -545,7 +545,7 @@ class MicroWebSrv :
def _writeFirstLine(self, code) :
reason = self._responseCodes.get(code, ('Unknown reason', ))[0]
self._write("HTTP/1.1 %s %s\r\n" % (code, reason))
# ------------------------------------------------------------------------
` Does not solve the problem completely. Now the connection setup for the websockets is not complete.
By the way, the effect is reproduced when using the PC version of the Safari browser.
Ok thank you very mutch, I'll see that 😊
Yes, I've updated the 1.0 to 1.1 version of HTTP and I've added a Content-Length header of 0 in the switching protocols headers... That's better for firefox ....! But I don't found the solution for safari, it's very strange because safari seem waits an header after the handshake response.
I checked the safari work with the ws: //echo.websocket.org/ site. Perhaps Wireshark will help to identify the difference in traffic.
I've analysed too and websocket.org have the same code in they test :) But there is a problem with the end of the headers I think ... That's works anywhere (android, windows IE, Chrome Firefox, Mac Chrome, Firefox) but not in safari.... I don't understand for the moment :'(
2018-03-05 12:34 GMT+01:00 vrubel notifications@github.com:
I checked the safari work with the ws: //echo.websocket.org/ site. Perhaps Wireshark will help to identify the difference in traffic.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jczic/MicroWebSrv/issues/19#issuecomment-370392278, or mute the thread https://github.com/notifications/unsubscribe-auth/AAegLAR-iFQXpRVRZ7jCGg9iWhOxnHT8ks5tbSLXgaJpZM4SbE4S .
--
Sincèrement,
I captured the servers' answers. Perhaps this will help you in your search for a reason.
bad.pcapng.zip good.pcapng.zip
Maybe there is a problem with this?
I assume that "Upgrade: websocket\r\n" have to be at last line
Yes I've found :) That's works now ! it's a bug with the base64 encoder... I've pushed the fix ;)
Thank you for this report 👍
Hmm I'll test that... Strange :/