As a learning project, I tried to develop an Android app (in Java) that can play games on Lichess.org using the Lichess API. Using OkHttp3, I managed to extract data from from the API. However, when actually playing games, you have to get Lichess to send you updates when a move has been made, and I got the impression that web sockets were the right technology for this. However, I keep getting the response
Response{protocol=http/1.1, code=200, message=OK, url=https://lichess.org/api/board/game/stream/<ID of my game>}
and the exception
java.net.ProtocolException: Expected HTTP 101 response but was '200 OK'
I was using an access token that had been given specific mandate to use the Board API.
My code can be seen in this topic on Stackoverflow where I also posted this previously, but didn’t get a reply yet:
https://stackoverflow.com/questions/77819221/web-sockets-and-the-lichess-api-on-android