Web Sockets now shipping in OkHttp 3.5!

1 · Jake Wharton · Dec. 2, 2016, midnight
Unlike the traditional request/response model of HTTP, web sockets provide fully bi-directional streaming of messages. This means that both the client and the server can send any number of messages to the other peer at any time. With today’s version 3.5 release, OkHttp now offers native support for web sockets! Connect a web socket by passing a request to the newWebSocket() method along with a listener for server-sent messages. OkHttpClient client = new OkHttpClient(); Request request = //... W...